Normally I get UTC + 2 (my timezone) timestamps for post. If I deactivate JS or look at the HTML source, what I see is UTC - 4 instead. Is this intentional? If so, why?
Where do you see actual time stamps on Discourse? Everything I see is relative (e.g., 1d, 2w, 1 January).
You see the local timestamp by clicking on the relative one. The timestamp I’m referring to can be seen by disabling JS.
Oh, hmm. I’d never noticed that undocumented feature.
Is your server UTC-4 by any chance?
@eviltrout can you confirm what time zone is used for the js off content we serve to Google?
It looks like UTC-4. When you view the source you see they’re in this format:
2014-10-23T22:15:40-04:00 – I believe the
-4:00 indicates that.
Really, it should be UTC. All the timestamps should be UTC - it’s just easier that way.
But there’s nothing wrong with
2014-10-23T22:15:40-04:00 - it’s an ISO 8601-compliant timestamp.
I just wonder where that specific time zone offset comes from @eviltrout?
It’s set here, in our application configuration:
Regardless, rails stores the date in UTC in the database and just uses that setting for formatting. It also has support for user-selectable time zones, we just don’t have that in Discourse yet.
We should change that to UTC, on that line.
Sure, but just so we’re clear, the timestamps included the offset so any date parser would have known the UTC anyways: