WordPress.org

Ready to get started?Download WordPress

Forums

daylight savings time (30 posts)

  1. tmountjr
    Member
    Posted 9 years ago #

    I just posted this afternoon to find out that the times are all slow one hour, thanks to the recent change off of daylight savings time (or is it on? Who knows?). I don't want to change my time to GMT-4 instead of GMT-5, because I'm not in the Atlantic time zome, I'm in the Eastern TZ. Anyone know how I can set WP (1.2) up to recognize daylight savings time changes?

  2. vkaryl
    Member
    Posted 9 years ago #

    I don't know that it's possible without writing a specific code hack of some sort. Does 1.2 display the time zone as such? 1.5 does not, you just select the relevant + or - hours from UTC. So today all I had to do was go change it in options from -7 to -6, and the time displays normally....

  3. Root
    Member
    Posted 9 years ago #

    My computer reset itself today but we moved to BST a week ago. :)

  4. moshu
    Member
    Posted 9 years ago #

    Maybe your computer was manufactured in North America :)
    We moved back today...

  5. moshu
    Member
    Posted 9 years ago #

    @ tmountjr,
    you can modify the -gmt stuff and add a capital T > which will show the time zone. But (there is always a BUTT:) it might depend on your servers setting whether it recognizes the DST or not.
    Another thing: if in your theme template the time format is hard coded, it won't work, though you can play with the settings (T) there, too.

  6. tmountjr
    Member
    Posted 9 years ago #

    Is that DST setting something I can find in cpanel?

  7. moshu
    Member
    Posted 9 years ago #

    Nope, it's done by your host when they set up the server. AFAIK

  8. vkaryl
    Member
    Posted 9 years ago #

    AFAIK, this is done through ssh or a bash shell, if your host allows, and even then it doesn't always work - I've tried it on 3 different servers, it worked once.

  9. llizard
    Member
    Posted 9 years ago #

    I was just looking at http://www.php.net/date

    I (capital i) Whether or not the date is in daylights savings time 1 if Daylight Savings Time, 0 otherwise.

    But I can't figure out where one puts the I. This is the syntax I have right now:

    Default date format: l, j F Y
    Default time format: H:i

    I tried
    Default time format: H:I

    but that, of course, doesn't work at all.

    Which file is it that actually deals with the date? In my search of these forums, I came across http://wordpress.org/support/topic.php?id=15140#post-87905

    I'd love to be able to alter the specific file to try the followin code:

    echo gmdate("F d, Y H:i:s", time() + 3600*($timezone+date("I")));

    Might it be in functions-formatting.php? I know very little about php coding, but perhaps somewhere after this line?


    // give it a date, it will give you the same date as GMT
    function get_gmt_from_date($string) {

    (I'm running WP1.2.2)

  10. Groove
    Member
    Posted 9 years ago #

    Would Daylight Savings Time affect the date format itself? Because since it happened, when I posted an entry the date format shows the entry as being posted one day later than I actually posted. And yet the actual time and date stamp for the entry is accurate. Has anyone else noticed this? Is it my server? Or something I need to fix elsewhere...

  11. llizard
    Member
    Posted 9 years ago #

    Sorry, don't know the answer to your question, Groove. The date is showing correctly in my blog....

    I have just upgraded to 1.5 in the hopes that the daylight saving aspect would be resolved. Alas, no. But googling, I found that this brilliant person has created a plugin to display daylight saving time!

    http://kimmo.suominen.com/2005/02/13/timezone/

    Note that this is not on the wp plugin page, but it works very well in 1.5....

    Note that the timezone plugin must go into the plugin folder and be activated first before it can be configured from the plugins page:

    wp-content/plugins/timezone.php

  12. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Is this a plugin for an event that occurs twice a YEAR ?

  13. llizard
    Member
    Posted 9 years ago #

    Yes, it is. If the event occurred zero times a year (which is as things SHOULD be) there would be no need for the plugin.

  14. Mark (podz)
    Support Maven
    Posted 9 years ago #

    I am amazed .... not that the plugin works, but that it was asked for and then used.

    Oh well .....

  15. llizard
    Member
    Posted 9 years ago #

    On the other hand, I'm amazed that everyone isn't clamouring for it.

    And if you take a look at the comments on the plugin page, you'll see that there are several people who wanted it.

    Chacun a son gout.

  16. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    I run most of my blogs in UTC since I don't care if the time is offset by five or six hours. My readers certainly don't care. They're probably in another timezone and couldn't care less where the sun is at over my head when I post. If they are hitting my RSS feed they get UTC anyway.

    In those instances where I do run the blog in my locale time, I simply change the UTC offset of my blog whenever I update the rest of the clocks in the house. That's what happens when the time changes, your UTC offset changes. If you look at any of the huge ass timezone databases, you'll see the DST change for a given timezone defined as a change from one offset to another at a given date and time. Here is an example zone description for the US Central time zone. Notice how the transitions are defined.

  17. llizard
    Member
    Posted 9 years ago #

    I hate everything about daylight saving. And I HATE having to change my clocks. So much so that I still haven't changed my wristwatch. So having a plugin to do this for me makes me very happy. If there were a plugin for automatically changing the time my wristwatch, I'd get it....

    The point I'm trying to make is that just because you don't want the plugin doesn't mean there aren't many others who are thrilled to have it.

    Now, if we were talking about the need for "Hello, Kings of Leon Kings of Leon lyric plugin", I would understand the mockery. :^)

  18. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    The plugin is fine, if you happen to be in an environment where it works. Automatic DST changing will likely never be in the WP core because getting it to work reliably across different servers and locales is a colossal chore. You simply can't rely on servers having a reliable and comprehensive TZ database, assuming they have one at all. Bundling a TZ database with WP is not an option because full TZ databases are many times the size of WP. Further, they require constant updating because DST rules are subject to the whims of government.

  19. llizard
    Member
    Posted 9 years ago #

    What exactly are you saying, Ryan? Are you saying that now that I have this particular plugin installed that the time stamp will not necessarily work for all viewers of my blog even if it is working for me? Is it just because my computer happens to understand it?

  20. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Fwiw - with all the blogs I read, I don't look at the time of the post. While I really can see that the time of posting matters to the blog owner, maybe it doesn't to readers ?

  21. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    Read Kimmo's restrictions. This plugin only works in certain environments. These restrictions won't affect your readers, but will affect your ability to use the plugin at all. If it's working for you, cool. WP, however, cannot ship something with such restrictions. There are very good reasons why you don't get DST support by default.

  22. llizard
    Member
    Posted 9 years ago #

    I see. Thanks.

    I hope that wasn't construed as a complaint that it wasn't on the wp plugin page! I was only reporting that it was not there.

    ---------------------------
    I hope that all this talk about the daylight saving plugin hasn't made people forget about the problem that Groove is having with the date....

  23. Kimmo Suominen
    Member
    Posted 9 years ago #

    I find it interesting to see what time of day the author was writing his/her entry. (I also assume that times shown on the blog match the time zone of the author.) I think it adds something to the post to know that it was written first thing in the morning, or after the evening movie was over, or after the bars had closed. :-)

    I also rather shorten the list of things to adjust twice (or any other number) a year than add to it. I'm glad that my plugin is helping others that feel the same way.

    It would also make my experience of contributing to the WordPress community much more enjoyable if I didn't have to read mocking comments about my handywork by official support staff on this forum. I just fail to see the value that such comments add (in the way of *support* or otherwise).

  24. Mark (podz)
    Support Maven
    Posted 9 years ago #

    @ruckus - I was NOT mocking either you, the code OR the original request. It was more of a "What / Why / But that's not often" in amazement rather than any sort of snorting derision. It would never have occurred to me to even request such a plugin - but then maybe I'd like a plugin that flashed up a warning 3 days before my wedding anniversary ...

    It was something that hadn't occurred to me, that's all.

  25. ceo
    Member
    Posted 9 years ago #

    Wait, I'm confused. At first I thought this was regarding the date set in the admin panel. But it seems we're talking about how the date, or rather the time, is shown in a post? If so, why do you need a plugin to do that - there's PHP format to imprint what timezone you're in and incorporate DST. I use l, F j, Y @ g:i A T on my blog, but I have to agree with Podz on that fact that I never really pay attention to post times, etc. when visiting other people's sites. (Heck not even on my own, I just like having the format there.)

  26. llizard
    Member
    Posted 9 years ago #

    Ceo, unless you live in GMT zone, or in one of the places in the world where daylight saving does not occur, you still have to go in twice a year and change the offset.

    For those of us who do care about the time posted on the post AND are annoyed and/or too lazy to have to change the time offset every six months, this plugin is a very nice thing to have. Many thanks for creating it, ruckus.

    Here is a list of timezones for those of us who think this plugin is useful:
    http://users.wpi.edu/~nv22/calendar/TIMEZONES

  27. DiabolicDevilX
    Member
    Posted 9 years ago #

    Shouldn't WP automatically determine whether it's daylight saving time or not? Like mentioned before it's an event that occurs twice a year and the user can't do anything about it but has to install A PLUGIN!!!?

    Shouldn't plugins been used to provide additional functionality, rather than adding functionality that should be self-evident?

    Just my two cents...

  28. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    Read the thread.

  29. llizard
    Member
    Posted 8 years ago #

    I have been unsuccessful in my search for how to surround the Timezone with a titled acronym tag. For instance, if I wanted to produce:

    <acronym title="Eastern Daylight Time">EDT</acronym>

    This is as close as I have come....

    <acronym <?php echo 'title="'. date(T). '">' . date(T); ?></acronym>

    But that just puts the acronym itself into the title spec rather than the full wording of the TimeZone. Any ideas? (I've tried searching on php.net but being relatively green at php, I cannot decipher most of what I see there)

  30. llizard
    Member
    Posted 8 years ago #

    Excuse me for replying to myself. I've done further searching and am getting a little closer. I have now successfully got the figured out how to get the title spec on acronym to have the value "GMT - 0400" when it is surrounding EDT:

    <acronym title="<?php echo gmdate(T). strftime('%z', $t) . '">'. date(T); ?></acronym>

    But I have not found where the_time() is defined in wordpress so that I can add the acronym tag. Perhaps I'm going to have to resort to using

    <?php date(H:i) ?> <acronym title="<?php echo gmdate(T). strftime('%z', $t) . '">'. date(T); ?></acronym>

    except that now this produces GMT - 0500 instead of GMT - 0400 in the title spec for EDT (Eastern Daylight Time)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags