0

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.

Matt Ball
  • 354,903
  • 100
  • 647
  • 710
Hoger
  • 73
  • 1
  • 2
  • 5
  • Its probably ticks in the number of milliseconds since January 1970 or something...or maybe not....you already understand everything here right: http://www.epochconverter.com/ – Jason Mar 14 '12 at 04:12
  • 2
    Thank you for your quick reply but that is not true, the miliseconds from the 1970 must be larger, while the above number is still small. – Hoger Mar 14 '12 at 04:14
  • @Jason naw, `22194885` in ms is only `Thu Jan 01 1970 01:09:54 GMT-0500 (EST)`; even in seconds it's still only `Mon Sep 14 1970 17:14:45 GMT-0400 (EDT)`. – Matt Ball Mar 14 '12 at 04:15
  • @Jason `getTime()` of `Date` object in `JavaScript` would give milliseconds time from 1970 but I think its not in C# – uday Mar 14 '12 at 04:17
  • 2
    How much does the number increment by between log entries? Can you correlate two specific numbers in that format to a specific real time? – Eric J. Mar 14 '12 at 04:18

3 Answers3

2

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.

Mark Tolonen
  • 166,664
  • 26
  • 169
  • 251
1

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.

Community
  • 1
  • 1
Eric J.
  • 147,927
  • 63
  • 340
  • 553
0

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.

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
  • Yeah, sorry Ben. My first calculation was backwards therefore counterintuitive, and I also had a typo stating seconds rather than minutes. – Eric J. Mar 14 '12 at 04:27
  • "Julian seconds"... let's hope not... A year 2000 problem once every year ;-) – Eric J. Mar 14 '12 at 04:29