• anonymous (unregistered)

    TL;DR

    Here people, more quickly (and amusignly) explained! http://www.youtube.com/watch?v=84aWtseb2-4

    Now excuse me, I'll go get furious at some stupid date calculations on the application I maintain...

  • anonymous (unregistered) in reply to Maltz
    Maltz:
    anonymous:
    public static bool isDaylightSavingTime() { DateTime dd = DateTime.Now; if (dd <= new DateTime(2012, 10, 28, 00, 59, 59) || dd >= new DateTime(2013, 03, 31, 03, 00, 00)) { return true; } else if (dd > new DateTime(2012, 10, 28, 01, 59, 59) && dd < new DateTime(2013, 03, 31, 02, 00, 00)) { return false; } else { return FILE_NOT_FOUND; } }

    There, I've fixed it.

    Not quite.

    It's not actually possibly to know if DST is active just by looking at the time during the Fall-Back hour between 1:00AM - 2:00AM. If you're going through that hour for the first time, then it's not DST. But then when you hit 2AM, you Fall Back to 1AM, and go through that hour for a second time, this time DST is active.

    That's why it returns FILE_NOT_FOUND.

  • (cs) in reply to Steven
    Steven:
    Another WTF about this is that smartphones (Android/iOS) have the DST scheme from 2005-2012 implemented in code (despite the calendar insanity, it is relatively simple to compute the dates). So any phone that hasn't gotten an update in the last 6 months switched prematurely on Sunday. Many, many people woke up late (including some that had phones that didn't move back).

    The real WTF is that the cell providers recommended changing phone's timezones to Athens, rather than pushing the timezone update through the network settings.

    No, the real WTF is that you don't know what you're talking about. Android (at least) has a timezone database with all this mess inside. The law to change the time was passed on July 2013, just two months before the original change date. (not 6 month. only 2.)

    Cell providers can't push firmware upgrades without manufacturers making them first, in phones they sold. And they can't don't control them at all in phones not sold by them. And it's not like Samsung, Apple, HTC, LG etc. are going to say: Emergency!!! Israel has changed DST rules, let's create a system upgrade now!!!!11111111. So it's really not in their hands, so they said change to Athens because its DST happens to end on the same date as in the new law.

  • Peter Michael Green (unregistered) in reply to Roby McAndrew
    Roby McAndrew:
    Dates and Times are so full of gotchas that your home brewed system is NEVER going to be close to bug-free. Use the libraries.
    Even using the libary you have to do deal with ambiguous local times, impossible local times, changes to DST rules that affect existing records (do you preseve the local time or the universal time? what if some participants are in timezones impacted by the change and some are not?), dealing with regular events that repeat across a DST boundry and so-on.
  • Peter Michael Green (unregistered) in reply to daily
    daily:
    Cell providers can't push firmware upgrades without manufacturers making them first, in phones they sold.
    Surely the real WTF is having a platform model where so many parties (first google, then the handset maker, then the network) have to be involved to get an update to a database that changes every few months to users.
  • cbretana (unregistered)

    ignoring the fact that .net already as a isDaylightSavingsTime function that works

  • (cs) in reply to cbretana
    cbretana:
    ignoring the fact that .net already as a isDaylightSavingsTime function that works

    Of course CS doesn't use it (It's currently 1:06am and I bet this comment will be posted at "2:06am")

    Edit: Nope, says 11:07, ignoring my timezone settings. Forums must be on a different system.

Leave a comment on “Daylight Failing Time”

Log In or post as a guest

Replying to comment #:

« Return to Article