UTC - 4 in timestamps?

(Jefffrey) #1

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?

(Michael Downey) #2

Where do you see actual time stamps on Discourse? Everything I see is relative (e.g., 1d, 2w, 1 January).

(Jefffrey) #3

You see the local timestamp by clicking on the relative one. The timestamp I’m referring to can be seen by disabling JS.

(Michael Downey) #4

Oh, hmm. I’d never noticed that undocumented feature. :wink:

Is your server UTC-4 by any chance?

(Jeff Atwood) #5

@eviltrout can you confirm what time zone is used for the js off content we serve to Google?

(Robin Ward) #6

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.

(Michael Brown) #7

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.

(Dean Taylor) #8

(Jeff Atwood) #9

I just wonder where that specific time zone offset comes from @eviltrout?

(Robin Ward) #10

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.

(Jeff Atwood) #11

We should change that to UTC, on that line.

(Robin Ward) #12

Sure, but just so we’re clear, the timestamps included the offset so any date parser would have known the UTC anyways:

(Jeff Atwood) #13