WordPress.org

Support

Support » How-To and Troubleshooting » Y2k7 bug after DST change – timestamps off by an hour in the US

Y2k7 bug after DST change – timestamps off by an hour in the US

  • This is a particularly annoying issue that I discovered this morning. Last night, I scheduled a post to be “published” later today (actually, about 30 minutes ago). When I saw my blog, however, the post hadn’t been published even though the time passed and the post itself was in Published status.

    The clocks changed last night here, and my server time is accurate, but according to my blog, the timestamps were off by an hour.

    In the WP options, the “Times in the weblog should differ by” was correct, somewhat. I am in -5 GMT (EDT zone), but WordPress does not seem to be aware of this new timezone shift. Basically, when I went to “write” a new post, I saw that WordPress was off by an hour — an hour earlier. (I had to change it to -4 in order for WordPress to see the right time. It saw 10:30 instead of 11:30.)

    I suppose this is a bug, and I’d love to know if anyone else is encountering this as well.

Viewing 15 replies - 1 through 15 (of 17 total)
  • WordPress takes it’s time from the server and you adjust it at Dashboard -> Options -> (I believe) General.

    If the server changed it’s time, then it’s not running on UTC/ GMT time.

    That’s what I said. I was in “General Options” — that’s where “Times in the weblog should differ by” field is located.

    I suppose I am waiting for WordPress to update its servers then, so my concern is still valid.

    Chris_K
    Member

    @handysolo

    If you’re waiting for wordpress to update servers, then you must be hosted over at wordpress.COM? We don’t support that product here. Visit http://wordpress.com/forums instead.

    If you’re hosting your own blog, then please explain why you’d be waiting for anything from wordpress servers?

    I’m having this issue as well. So if I’m hosting on my own site, the wordpress software is pulling time from my own server? Does this mean my server/hosting service hasn’t updated to daylight savings?

    Update: OOP. Just for clarification, so it seems like the software doesn’t automatically make adjustments for DST? Sorry. I just started using WP in November and haven’t encountered time change yet.

    HandySolo, I host on my own server, so I was just going upon what drmike said. My server has the right time. It is 15:32 right now. When I click on “Write” on my blog post, however, it says that the time is 14:32, which is clearly wrong but must be a result of the -5 GMT issue. If I switch to -4 GMT in my General Options, the time gets corrected, but technically, the Eastern timezone is not -4 GMT.

    Therefore, it must be a “bug” relating to the DST update (and that’s why I called it the Y2k7 bug) 😉

    Les Bessant
    Participant

    @lesbessant

    It’s not a bug. WP doesn’t have any built in code to correct for time changes. The offset is the difference between UTC and the time you want displayed on your site – not necessarily the local time on the server, as many people use hosting that’s not in their local time zone.[1]

    As far as I recall, it’s always been necessary to change the offset twice a year if your chosen time zone has a time change (or DST in the US).

    Unlike a lot of software issues you’ll have heard about, WP is not affected by the changes in the US.

    [1] I’m in the UK, my server is in California.

    Thanks for the clarification, LesBessant. I suppose then that for DST, I’ll just have to force the script to offset -4 hours instead of -5. Then when GMT has its own timezone switch (which I don’t know of), I’ll be in the dark but know how to resolve it from this instance.

    I would request, then, that there be some sort of testing that can perhaps get the server time and use that for the post times rather than offsets of GMT. I still don’t know how it’s determining GMT -4, and my server local time is correct for my timezone.

    I put in a feature request to have WordPress automatically update for DST some time back: http://wordpress.org/extend/ideas/topic.php?id=369&replies=5

    It could probably use some votes, if anyone would like to see this feature appear in an upcoming release. 🙂

    Les Bessant
    Participant

    @lesbessant

    If you’re in the US Eastern Time Zone, your local time is currently GMT-4, as GMT is still in effect in the UK. In the UK, we’ll be putting our clocks forward later in the year, but that won’t have any effect on your server.

    No testing or changing is needed. It’s a simple manual change that users affected by DST need to make twice a year. Using server time would be bad for lots of people – they’d have to work out their offset from the server’s local time rather than from GMT, which is generally available information.

    Right Les, but I should not be expected to know when Greenwich changes its clocks. I mean, I’m a 7 hour flight away. 😛

    As far as I’m aware, the Eastern timezone is *always* GMT -5. This year, based on specific changes that are new beginning in 2007, Eastern time is GMT -4 now and will be for another month. Central time is now GMT -5 when it was previously GMT -6, Mountain time is GMT -6 when it was previously GMT -7, and Pacific time is GMT -7 but was previously GMT -8. It affects an entire country based on new changes made by our government.

    My point lies more in the fact that I am confused about where WordPress gets this GMT time. Since my local server time *is* correct, how is WordPress finding GMT to begin with and making the [in]accurate GMT assessment?

    I know getting the server time could be bad for lots of people, including yourself with a server in California while you reside in the UK. But if the option had something like “your local server time is: 16:00. Do you want to use this time?,” I’d be happy.

    Again, I’m still just confused on how WordPress is finding GMT.

    GMT is NEVER inaccurate. GMT is the time-standard the world around (actually, more properly, UTC is that time standard, but many people still use GMT).

    I would imagine UTC is hard-coded into the core files somewhere. It doesn’t matter what this country does with DST, because UTC is not going to change. Even at the point which the UK goes to DST, UTC is the same time, only people are on different time.

    You could simply do like I am this year: tell the gov’t to stuff it. Of course, I’m retired, no kids, and run my own business, so I don’t really have to keep track much.

    Regardless, unless someone thinks it’s a smashing idea to have wp find DST the world around (somehow…. – and I personally don’t find it a good idea at all), it’s not too big a deal to reset the UTC offset twice a year.

    I didn’t mean “inaccurate” in that sense, vkaryl. I’m just confused because I’m typically used to the GMT -5 but now I’m faced with GMT -4 for awhile, and my expectation is to switch when the UK changes its clocks, but that’s unrealistic for those of us who don’t reside there.

    No – you won’t switch when the UK switches, because UTC will remain the same, only the people in that country will change their clocks. I realize it’s confusing, but the only thing you need to keep track of is -4 to UTC/GMT during OUR DST period, and -5 to UTC during our Standard Time period.

    I guess I have less trouble with this than some since I not only have a daughter living in Germany, I have many friends in the UK, France, Belgium etc. So I’m just used to messing with time….

    I suppose so. I’m generally good with these timezone changes but this year it is a little more confusing given that we’re doing it a month earlier.

    And btw – in General Options, it does say the following:

    Times in the weblog should differ by: X hours (Your timezone offset, for example -6 for Central Time.)

    -6 is not accurate anymore, so this is somewhat of a bug report after all, I guess.

    You can always report that as a bug at http://trac.wordpress.org

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Y2k7 bug after DST change – timestamps off by an hour in the US’ is closed to new replies.