0

I have a supposed Unix date format coming through in a json feed from a third party that looks like this:

/Date(1391741913713+1100)/

Is there any way I can parse that to a DateTime object?
I'm not convinced this is a "true" Unix dateTime object...

Looking at the accepted answer to this question: How to convert a Unix timestamp to DateTime and vice versa? The parsing method takes a double... my string contains +1100 (as well as the outder /Date()/ part)

Community
  • 1
  • 1
Alex
  • 37,502
  • 51
  • 204
  • 332
  • It's not a unix timestamp integer. It's number of milliseconds since unix epoch – zerkms Mar 05 '14 at 23:44
  • That's what I thought, despite the third party insisting it is.... edited question to reflect this. – Alex Mar 05 '14 at 23:44
  • 1
    Well, third party has no idea what they are talking about then :-) – zerkms Mar 05 '14 at 23:45
  • 1
    http://stackoverflow.com/a/3339237/251311 – zerkms Mar 05 '14 at 23:46
  • Ah, that looks interesting.... the regex may help me out.... let me try that – Alex Mar 05 '14 at 23:48
  • 1
    To be scientifically correct: is there a definition of the "Unix timestamp"? It's by convention that we know it refers to the number of seconds since 1970. But you can express a "Unix timestamp" (meaning a timestamp showing the time elapsed since the Unix epoch) in milliseconds as well. – Sandman Mar 08 '14 at 14:25

1 Answers1

0

As it happens, when parsing from JSON using JSON.net, this is handled automatically

Alex
  • 37,502
  • 51
  • 204
  • 332