• ¯\(°_o)/¯ I DUNNO LOL (unregistered) in reply to quibus
    quibus:
    O RLY?:
    There are always 24 hours in a UTC day. The solution is to convert from local time (rounded off to the nearest day) to UTC, add the 24h, then convert back. If you're worried about leap seconds (which almost no one cares about), add 24h+1s.
    It's the 25th of October, and I want to find tomorrow's date. I convert midnight on the 25th from BST to UTC, getting 23:00 on the 24th. I add 24 hours, getting 23:00 on the 25th. I convert that back to local time, and since BST has now ended, I still get 23:00 on the 25th. Therefore, the day after the 25th of October is the 25th of October. QED?
    The real, real, php_real_solution() is to take the date, put it into a date/time object, and set the time to noon. Then when you add or subtract 24 hours, the day will be correct, regardless of DST.

    ...or at least until someone decides to have a 12-hour DST time shift.

  • (cs) in reply to Guestimate
    Guestimate:
    KBKarma:
    datetime.date.today() + datetime.timedelta(days=1)
    As I assume that that "timedelta" has no awareness of the current day, I guess that it will return an unexpected result for any day just before a dayligh-savings switching -- where the next day will be either one hour long or short.

    Granted, in the current case it will probably only cause a problem when summertime starts (next day has less than 24 hours), and its near to midnight. But still.

    You assume incorrectly.

  • Recursive call (unregistered)

    Hate to bring it to you but morgen(morgen()) is not a recursive call.

  • trwtf (unregistered)

    The real wtf is, that php has functions like strtodate

  • (cs) in reply to Caffeine
    Caffeine:
    Does it not also fall on the 29th of February, returning the first of February for morgan?

    You fail, for misspelling morgen with an a

  • azerazerazerazer (unregistered) in reply to quibus
    quibus:
    O RLY?:
    There are always 24 hours in a UTC day. The solution is to convert from local time (rounded off to the nearest day) to UTC, add the 24h, then convert back. If you're worried about leap seconds (which almost no one cares about), add 24h+1s.
    It's the 25th of October, and I want to find tomorrow's date. I convert midnight on the 25th from BST to UTC, getting 23:00 on the 24th. I add 24 hours, getting 23:00 on the 25th. I convert that back to local time, and since BST has now ended, I still get 23:00 on the 25th. Therefore, the day after the 25th of October is the 25th of October. QED?

    Fail.

    The DST swith happens on 2AM/3AM. The 25th of October contains 24 hours. The 26th of October contains 23 hours.

    Meaning: you are one day off..

    The day after the 25th of October is the 26th of October. The day after the 26th of October however is the 26th of October.

  • gravis (unregistered) in reply to azerazerazerazer
    azerazerazerazer:
    The DST swith happens on 2AM/3AM.

    Fail.

    The word is "switch", not "swith".

    Meaning: you are one letter off..

  • Norman Diamond (unregistered) in reply to azerazerazerazer
    azerazerazerazer:
    quibus:
    O RLY?:
    There are always 24 hours in a UTC day. The solution is to convert from local time (rounded off to the nearest day) to UTC, add the 24h, then convert back. If you're worried about leap seconds (which almost no one cares about), add 24h+1s.
    It's the 25th of October, and I want to find tomorrow's date. I convert midnight on the 25th from BST to UTC, getting 23:00 on the 24th. I add 24 hours, getting 23:00 on the 25th. I convert that back to local time, and since BST has now ended, I still get 23:00 on the 25th. Therefore, the day after the 25th of October is the 25th of October. QED?
    Fail.

    The DST swith happens on 2AM/3AM. The 25th of October contains 24 hours. The 26th of October contains 23 hours.

    Meaning: you are one day off..

    The day after the 25th of October is the 26th of October. The day after the 26th of October however is the 26th of October.

    Here, I'll give you a C for that.

    You fail reading comprehension. quibus is not talking about the DST of the US and its colonies. Nonetheless you might have counted the hours correctly.

    http://en.wikipedia.org/wiki/British_Summer_Time

  • Norman Diamond (unregistered)

    Hmm, come to think of it, on rereading http://en.wikipedia.org/wiki/British_Summer_Time, it looks like the switch is made several seconds earlier than an actual hour boundary, if the switch is made at 01:00 GMT instead of 01:00 UTC.

  • (cs) in reply to foo AKA fooo
    foo AKA fooo:
    No, TRWTF is the name. Seriously, Stephaan? Not Hanzo? Oh, I understand Eriek's method of anonymization, just add a random vowel to any name ...
    It's presumably a Dutch name.
  • Dilbert (unregistered) in reply to lucidfox
    lucidfox:
    foo AKA fooo:
    No, TRWTF is the name. Seriously, Stephaan? Not Hanzo? Oh, I understand Eriek's method of anonymization, just add a random vowel to any name ...
    It's presumably a Dutch name.

    It's presumably form a German speaking country... The Uebermorgen should have been your clue..

    captcha Quibus: Close to Dutch Kwiebus = Silly Person

Leave a comment on “Day After Übermorgen”

Log In or post as a guest

Replying to comment #:

« Return to Article