I have a timestamp exported from a program that I'm not sure how to convert programmatically using c#
I can get more examples if required
any pointers would be appreciated
1280833200 == 3 aug 2010 12:00
thanks,
Mark
I have a timestamp exported from a program that I'm not sure how to convert programmatically using c#
I can get more examples if required
any pointers would be appreciated
1280833200 == 3 aug 2010 12:00
thanks,
Mark
isnt that the datetime in ticks Unix time?
edit: yes it is: http://www.epochconverter.com/
You can make a DateTime
by adding those seconds to a new date.
DateTime d = new DateTime(1970, 1, 1, 0, 0, 0)).AddSeconds(1280833200)
This is a Unix timestamp; number of seconds since Jan 1, 1970. You can convert like:
DateTime epoch = new DateTime(1970,1,1);
DateTime ts = epoch.AddSeconds(1280833200);
It's Unix time - the number of seconds since midnight UTC on 1st January 1970. You can use this site to convert the timestamp to an ordinary date and time.
As for conversion in C#, this should work:
double timestamp = 1280833200;
DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);
dateTime = dateTime.AddSeconds(timestamp);