I am parsing an XML file that has a field called UTCTime and contains the value 1311346453064. It also comes with a field called UTC that contains the value 2011-07-22T10:54:13.064-04:00 which is a complete .Net DateTimeOffset I believe. The first field I can’t figure out though. What generates a date in that way? It’s too large to be a unix timestamp since it adds about 41 millenia to 1/1/1970. Any help in identifying it or how I can convert it to a datetime without using that second field would be a great help! Thanks.
Share
It is equivalent to the unix timestamp [i.e. a straight count since 1970] but in milliseconds instead of seconds.
Ending with
3064made it obvious to me.So, to convert in .NET you would use
Or, slightly more efficiently at a cost of some readability
Note that this discards the timezone information (the offset of
-04:00) in the other field.