Namespaces
Variants
Actions

How to convert Unix Time to .net DateTime

Jump to: navigation, search

This article explains how to convert UNIX Datetime to .Net DateTime in local format.

SignpostIcon Code 52.png
MultiMediaTile.png
Article Metadata

Compatibility
Platform(s): Windows Phone 7.5

Article
Created: nilay.shah3nov (26 Aug 2012)
Last edited: hamishwillee (10 Apr 2013)

UNIX Time

Unix time, or POSIX time, is a system for describing instances in time, defined as the number of seconds that have elapsed since midnight Coordinated Universal Time (UTC), January 1, 1970, not counting leap seconds. It is used widely in Unix-like and many other operating systems and file formats. It is neither a linear representation of time nor a true representation of UTC. Unix time may be checked on some Unix systems by typing date +%s on the command line.

How to Convert Unix Time to .Net System.DateTime

System.DateTime unixTime = new System.DateTime(1970,1,1,0,0,0,0, DateTimeKind.Utc);
DateTime myDate =unixTime.AddSeconds(1258598728).toLocalTime();
This page was last modified on 10 April 2013, at 04:28.
150 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved