0

I haven't been able to find an answer to this, and I was hoping y'all could help me out. When accessing the API for one of the products we use at work, a date field comes back in two different forms depending on if you request JSON or XML.

The first, which I understand, is what XML sends:

2014-12-03T23:59:00

The second, is what I can't figure out. When requesting JSON, it sends the same date in the following format:

\/Date(1417672740000-0600)\/

Forgive me if this has already been answered, I just haven't been able to find it here or on Google. Hopefully it's something I should already know.

FYI, I'm using the requests module for Python.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
  • Looks like it's the format from DataContractJsonSerializer apart from anything else - millis since the Unix epoch, and offset from UTC. – Jon Skeet Dec 03 '14 at 23:09
  • 1
    When talking about dates, listen to what @JonSkeet says. He knows what he's talking 'bout: http://stackoverflow.com/questions/6841333/why-is-subtracting-these-two-times-in-1927-giving-a-strange-result/6841479#6841479 (sorry, it's probably been 2 years after I saw it, but I'm still amazed by that answer) – Savir Dec 03 '14 at 23:11
  • Thanks Jon, that's exactly what this is. – timbecoding Dec 03 '14 at 23:36

1 Answers1

0

Jon Skeet:

Looks like it's the format from DataContractJsonSerializer apart from anything else - millis since the Unix epoch, and offset from UTC