Reputation: 63
I have a very simple issue with datetime and am seeking some help.
I have a log that I would like to get all data information from. There are three columns of datetime formats (2 in UNIX timestamp while the other isn't).
The one with different timestamp format offers a value of, for example, 22194885
which I don't know which datetime type it belongs to.
Upvotes: 0
Views: 16616
Reputation: 177891
Looks like minutes since January 1, 1970. this is Python code, but works the same as C localtime():
>>> import time
>>> time.localtime(22194885*60)
time.struct_time(tm_year=2012, tm_mon=3, tm_mday=13, tm_hour=19, tm_min=45, tm_sec=0, tm_wday=1, tm_yday=73, tm_isdst=1)
Works out to 3/13/2012 7:45pm.
Upvotes: 2
Reputation: 150138
Looks like it could be minutes since the Epoch, rather than milliseconds
22194885 minutes / 60 = 369914.75 hours
369914.75 hours / 24 = 15413.1 days
15413.1 days / 365 = 42.2 years
1970 + 42.2 = about today
For help converting Epoch time to .Net time, see
How to convert a Unix timestamp to DateTime and vice versa?
Remember that question deals with milliseconds, so you'll have to adjust the answer slightly.
Upvotes: 1
Reputation: 283713
Based on the calculations in Eric J's answer (which has been deleted), this could well be the number of minutes since the epoch. Bah! He slipped in a ninja edit.
Julian seconds (since the start of the year) is also a strong possibility.
Upvotes: 0