Search code examples
parsingdateencoding

How is this date field encoded?


I am consuming an REST service that allows me to query a table in a database. There is a date field in that table, but the service is returning the date in a strange format, and I'm unsure how to parse it.

I know for a fact that a certain record's date is 2010/07/16 00:00:00 UTC, and the string that I get for the date is 1279238400000. How is this date being encoded? How to I get from that large number to July 7, 2010?


Solution

  • I think what you're having is milliseconds since 1970-01-01.