3

I got a .Net Date Object back from my get request that looks like this

/Date(1503528300000-0500)/

I see this post Date conversion .NET JSON to ISO about how to convert it to ISO. but how about Python dateTime (not php)? Ultimately I want to use datetime.datetime.now() to compare with the converted datetime and get the difference.

and can someone please explain what is the part after the -? in this case what is the 0500?

10
  • Possible duplicate of PHP date format /Date(1365004652303-0500)/ Commented Aug 24, 2017 at 1:32
  • My inquiry clearly states Python not PHP Commented Aug 24, 2017 at 1:34
  • Core concept is the same Commented Aug 24, 2017 at 1:34
  • The 0500 appears to be the offset from UTC. Depending on DST, that could be Eastern or Central for North America. Commented Aug 24, 2017 at 1:35
  • 1
    @J.Doe for sure. The offset is just the number of hours from "zulu" time, or UTC. The Z in an ISO 8601 date/time indicates Zulu time. You want to be careful with offsets, however, and double check whether they're standard or DST (daylight savings time). I recommend storing in UTC ALWAYS, then present according to local offset at the time (again, changes with DST). Commented Aug 24, 2017 at 1:42

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.