views:

43

answers:

1

I have a file with dates and times listed as huge numbers like 634213557000000000. I believe this is a .NET tick. That's the number of 100 nanosecond increments since midnight on January 1, 1 A.D. What's a good way to read that into a python datetime object?

+4  A: 
datetime.datetime(1, 1, 1) + datetime.timedelta(microseconds = ticks/10)

For your example, this returns

datetime.datetime(2010, 9, 29, 11, 15)
Mark Ransom