Closed Bug 1097582 Opened 11 years ago Closed 11 years ago

Time stamp for updated property of question/answer is server time and no TZ

Categories

(support.mozilla.org :: BuddyUp, defect, P2)

All
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED FIXED
2014Q4

People

(Reporter: espressive, Assigned: mythmon)

References

Details

(Whiteboard: u=dev c=buddyup p=1 s=2014.21)

When listing a question and answers/comments or, posting a question or answer, the value of the updated property is as follows: 2014-11-12T02:08:15 and when posting, the repose will be slightly different i.e. 2014-11-12T02:25:11.971 When I then run this through a formatter that converts this to relative time, it will come back with say '10hrs ago' even though I just posted the question seconds ago. With the time stamps as they currently are, there is no real way to determine the time zone offset and therefore it presents a problem. If we can assume that the server time will always be PST, we can possibly get around that but, I am interested to know what suggestions you may have. I guess, us posting the time when the question/comment is made to the server is not an option?
Flags: needinfo?(rrosario)
Flags: needinfo?(mcooper)
Sounds like we either need to make the datetime include the TZ or convert the times to UTC.
Flags: needinfo?(rrosario)
Whiteboard: u=dev c=buddyup p= s=2014.21
Priority: -- → P2
Target Milestone: --- → 2014Q4
espressive: As a work around, it can be assumed that all times are in server time. The server is in Pacific time. That means that it is *either* in PST or PDT, depending on the time of the year. Which basically means it's going to be stupidly complex for you to deal with. Since we just switched back to PST you can assume an offset of UTC-8, at least for the next few months. I think we should make the API output only UTC, and state it explicitly. Additionally, when accepting times from API users, it should respect time zone marking in time stamps. I bet we already do this, but we should check and add tests. The server should serialize like one of 2014-11-12T02:08:15+0000 or 2014-11-12T02:08:15Z, both of which mean UTC time in ISO 8601. espressive: it looks like you had some discrepencies in the update time? I think this is because the server sets the updated time itself, and your clock is probably slightly different than the servers.
Flags: needinfo?(mcooper)
Am I correct that I can now assume that all time stamps returned will be UTC time in ISO 8601?
Flags: needinfo?(mcooper)
Yes. I'm converting the timestamps to UTC format, and then DRF outputs that as 2014-11-15T13:23:51Z. The Z on the end indicates Zulu, or UTC time according to ISO 8601.
Flags: needinfo?(mcooper)
Deployed to prod. I think this was 1pt.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: u=dev c=buddyup p= s=2014.21 → u=dev c=buddyup p=1 s=2014.21
:mythmon did this.
Assignee: nobody → mcooper
You need to log in before you can comment on or make changes to this bug.