The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

The Real WTF is in the countdown

Last post 06-01-2007 7:03 PM by asuffield. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 05-06-2007 11:44 AM

    The Real WTF is in the countdown

    After noticing that the "time left to enter" countdown turns over a new day at midnight my time, I had a look at the page source. I didn't expect this kind of WTF:

    				    var endDate = new Date('5/14/2007 11:59:59 PM');
    var now;
    var countdownSpan = document.getElementById('jsCountdown');
    var differenceText;
    var workingTicks, seconds, minutes, hours, days;

    function UpdateCountdown()
    {
    now = new Date(Date());
    if (now >= endDate)
    {
    // Negative infinity. Just for kicks.
    countdownSpan.innerHTML = -(1 / 0);
    return;
    }
    // Some hacky stuff to get around no DateDiff()...
    workingTicks = Math.floor((endDate - now) / 1000); // Disregard milliseconds
    seconds = (workingTicks % 60);
    if (seconds < 10) { seconds = '0' + seconds; }
    workingTicks = Math.floor(workingTicks / 60);
    minutes = (workingTicks % 60);
    workingTicks = Math.floor(workingTicks / 60);
    hours = (workingTicks % 24);
    workingTicks = Math.floor(workingTicks / 24);
    days = workingTicks;
    differenceText =
    days + '&nbsp;day(s), ' +
    hours + '&nbsp;hour(s), ' +
    minutes + '&nbsp;minute(s) and ' +
    seconds + '&nbsp;second(s)'
    countdownSpan.innerHTML = differenceText;
    // Let's see if someone spots this and submits it as a WTF
    setTimeout('UpdateCountdown()', 850);
    }

    UpdateCountdown();

     Took me a while to work out the WTF about the second underlined part, but if you watch the countdown intensely, you will notice it doesn't tick at a constant rate, freezing up slightly sometimes due to a new second not occurring in the 850 milliseconds between refreshing the counter. I'm guessing this was put in to mess with the minds of those who would look at the countdown and swear their eyes were playing tricks on them.

    Download my OMGWTF entry, Romanorum Computus
  • 05-06-2007 12:00 PM In reply to

    • tster
    • Top 10 Contributor
    • Joined on 04-11-2006
    • Natick, MA
    • Posts 1,295

    Re: The Real WTF is in the countdown

    nice catch.
    The pig go. Go is to the fountain. The pig put foot. Grunt. Foot in what? ketchup. The dove fly. Fly is in sky. The dove drop something. The something on the pig. The pig disgusting... see bio for the earth shattering ending.
  • 05-07-2007 12:56 AM In reply to

    Re: The Real WTF is in the countdown

    The real WTF is that you lost time for that :)

  • 05-11-2007 2:50 PM In reply to

    Re: The Real WTF is in the countdown

    The Real WTF is that it's using a date with no time zone on it.  The contest rules say it ends at 5/14/2007 11:59:59 PM EST.  I'm sure there are places, but I don't know of any that are still on EST, almost all having switched to EDT a while back.  Of course, JavaScript could do some magic, or always assume standard time, but that'd be another class of WTFery.
  • 05-11-2007 4:16 PM In reply to

    • SamP
    • Not Ranked
    • Joined on 05-05-2007
    • Posts 25

    Re: The Real WTF is in the countdown

    The real WTF is that you can argue for days about which is the last hour to submit your calculator (or any other project, for that matter)

     Just submit it a day early...
     

  • 05-14-2007 5:49 PM In reply to

    Re: The Real WTF is in the countdown

    Ehm...did you guys notice something odd? I've been checking the countdown throughout the day (dunno why, though), and here's what I've seen:

    9h 40m left
    6h 30m left
    5h 30m left
    2h 30m left
    6h 11m left

    WTF?!

     

    I just watched Deja Vu, so I'm kinda paranoid at the moment... I didn't go back in time or anything, did I?
     

    OMGWTF - Are you enterprisey enough?
  • 05-15-2007 12:10 AM In reply to

    Re: The Real WTF is in the countdown

    -Infinity seconds left to go!
  • 05-15-2007 12:13 AM In reply to

    Re: The Real WTF is in the countdown

    freelancer:

    Ehm...did you guys notice something odd? I've been checking the countdown throughout the day (dunno why, though), and here's what I've seen:

    9h 40m left
    6h 30m left
    5h 30m left
    2h 30m left
    6h 11m left

    WTF?!

     

    I just watched Deja Vu, so I'm kinda paranoid at the moment... I didn't go back in time or anything, did I?
     

     

    Time zones where accounted for sometime between the times you accessed it 

    EDIT: I think 

    Download my OMGWTF entry, Romanorum Computus
  • 05-15-2007 12:52 AM In reply to

    • Zor
    • Not Ranked
    • Joined on 05-14-2007
    • Posts 7

    Re: The Real WTF is in the countdown

    I've already submitted, but I'm locked out from submitting now. According to the faq, the deadline is "May 14, 2007, 11:59 PM EST.", which means I should have about 10 more minutes. If he really meant EDT, I should have 1 hour 10 minutes left. Maybe he meant CST?
  • 05-15-2007 12:14 PM In reply to

    Re: The Real WTF is in the countdown

    poochner:
    The Real WTF is that it's using a date with no time zone on it.  The contest rules say it ends at 5/14/2007 11:59:59 PM EST.  I'm sure there are places, but I don't know of any that are still on EST, almost all having switched to EDT a while back. 

    I was going to say parts of Indiana, but apparently as of last year the whole state observes DST.  Too bad, the whole three-times-in-two-time-zones-in-one-state thing was a neat little WTF unto itself.

     

    What Would Brian Boitano Do?
  • 06-01-2007 1:22 PM In reply to

    Re: The Real WTF is in the countdown

    cconroy:

    poochner:
    The Real WTF is that it's using a date with no time zone on it.  The contest rules say it ends at 5/14/2007 11:59:59 PM EST.  I'm sure there are places, but I don't know of any that are still on EST, almost all having switched to EDT a while back. 

    I was going to say parts of Indiana, but apparently as of last year the whole state observes DST.  Too bad, the whole three-times-in-two-time-zones-in-one-state thing was a neat little WTF unto itself.

     

    Of course, look at the big picture - switching time zones for some western counties at the same time now means that for programs wanting to have historically correct data back to 1970 (as the tz database tries to), there are now no less than NINE zones applying to the state. (shame that it only goes back to 1970 - some of the real WTFery happened in the 60s from what i've read - with the time zone line slowly creeping westward over the course of the decade) 

  • 06-01-2007 7:03 PM In reply to

    Re: The Real WTF is in the countdown

    Random832:
    cconroy:

    poochner:
    The Real WTF is that it's using a date with no time zone on it.  The contest rules say it ends at 5/14/2007 11:59:59 PM EST.  I'm sure there are places, but I don't know of any that are still on EST, almost all having switched to EDT a while back. 

    I was going to say parts of Indiana, but apparently as of last year the whole state observes DST.  Too bad, the whole three-times-in-two-time-zones-in-one-state thing was a neat little WTF unto itself.

    Of course, look at the big picture - switching time zones for some western counties at the same time now means that for programs wanting to have historically correct data back to 1970 (as the tz database tries to), there are now no less than NINE zones applying to the state. (shame that it only goes back to 1970 - some of the real WTFery happened in the 60s from what i've read - with the time zone line slowly creeping westward over the course of the decade) 

    And observe that a piece of software which needs to compute what time it was "X hours before Y" has to use *all* of them, and imagine just how horrible that code must be. 

Page 1 of 1 (12 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems