You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dates I get back from our server (Django/Piston) are of this format:
"2013-11-13T05:33:02.965Z"
I wanted to not lose the milliseconds portion because my modified date attribute check was failing because I was seeing some sub-second date changes. I changed the iso8601TimestampToDateValueTransformer as follows:
One thing that jumped out at me was the original version was using mktime, and I was getting dates that were shifted into the future by the number of hours my local timezone was offset from UTC. Since all dates I get back from the server are UTC, using 'timegm' got me the correct date.
As all this C date parsing stuff is new to me, I was hoping to get some feedback on the above changes and maybe they are of some use to you.
The text was updated successfully, but these errors were encountered:
@chadpod Thanks for the changes here. We definitely just need to blow out the test coverage with additional cases. IIRC the parser should be handling timezone offset formats and sending either ‘Z’ or ‘+0000’ would indicate a UTC absolute time. I am guessing that the addition of the milliseconds is throwing off the positional checks.
I think we need tests for:
Timestamp string without offset (should be assumed UTC)
Timestamp string with +/- XXXX
Timestamp string with Z
Timestamp string with milliseconds without offset (should be assumed UTC)
Timestamp string with milliseconds with +/- XXXX
Timestamp string with milliseconds and Z
When we have all of these in place and passing we’re probably in good shape.
Going to work on this a bit and see what I can pull together for you. On the timezone stuff, my understanding is mktime will use the local timezone, regardless of what timezone is in the tm time struct. Seems to be what the docs say and my limited testing seems to agree.
The dates I get back from our server (Django/Piston) are of this format:
"2013-11-13T05:33:02.965Z"
I wanted to not lose the milliseconds portion because my modified date attribute check was failing because I was seeing some sub-second date changes. I changed the iso8601TimestampToDateValueTransformer as follows:
One thing that jumped out at me was the original version was using mktime, and I was getting dates that were shifted into the future by the number of hours my local timezone was offset from UTC. Since all dates I get back from the server are UTC, using 'timegm' got me the correct date.
As all this C date parsing stuff is new to me, I was hoping to get some feedback on the above changes and maybe they are of some use to you.
The text was updated successfully, but these errors were encountered: