• (cs) in reply to Patrick
    Patrick:
    Sunday Ironfoot:
    ... DAY/MONTH/YEAR ?

    So need to a) Make sure locale settings on the deployment server at set to UK/Europe b) Make sure other developers who use this code pass in a string date in UK/EU format. ...

    Just FYI, it's not called UK/Europe format, it's called Everywhere-That-Isn't-USA format. So technically there's nothing wrong with it. TRWTF is Month/Day/Year.

    The RWTF is locale settings.

  • (cs) in reply to Seriously Dude
    Seriously Dude:
    Daniel:
    On a side note dd/mm/yy makes a whole lot more sense than mm/dd/yy... so does the metric system
    On the other side, yyyy/mm/dd makes even more sense: it compares, sorts correctly, and also happens to be THE ISO STANDARD.

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

    (Once you finish bending that delim from "/" to "-")

    Replace(MyDate, "/", "-")

    Voilà

  • Patrick (unregistered)

    My [over-simplified] comment caused two pages of debate. Excellant. My work here is done. If it wasn't obvious, the intent was to wake up the americans who think d/m/y is just plain wrong (of whom there seem to be many), and watch as they split hairs trying to invalidate it. So, congratulations, you're not the only ones who use m/d/y, there are also a couple of tiny places no-one cares about too. Happy?

  • SpinalTap (unregistered) in reply to d000hg
    d000hg:
    I just love how it can return 3.

    But this one goes to 11

  • (cs) in reply to K&T
    K&T:
    Just FYI, it's not called UK/Europe format, it's called Everywhere-That-Isn't-USA format. So technically there's nothing wrong with it. TRWTF is Month/Day/Year.

    FYI, you're wrong

    But then, sniff, it's India, sniff, that uses the least, sniff, WTFy date format! Booooohoooooohoooohoooohoooo! what a shame for the rest of the world.

  • Yufeng Chen (unregistered)

    OMg, I used this exactly method back in high school

  • me (unregistered)

    Well this guy obviously doe not like libraries :) He prefers to do things on his own. Seems like someone who just started to learn a new language and deciding to write more code instead of doing a "little research". Anyway I suppose this is somewhat creative... just look at how he makes sure it will work by using 1, 100 and 10000. He knows that 1, 10 and 100 would not work :-P

  • b (unregistered) in reply to Machine Head
    Machine Head:
    Sunday Ironfoot:
    a) Make sure locale settings on the deployment server at set to UK/Europe b) Make sure other developers who use this code pass in a string date in UK/EU format.
    It's UK-Format. Other regions use other date formats.
    Because the Queen of Europe lives in England?
  • (cs) in reply to K&T

    Does Africa not use dates? Holy crap, Wikipedia.

  • Just a girl (unregistered) in reply to Jonah
    Jonah:
    try { ... } catch(Exception) { return 3; }
    A new design pattern is born! From now on, I'm going to use this in all my functions.

    Kinda funny... looks like C++ to me. In C++, return 0; immediately terminates an application. Not sure what kinda exception he's trying to catch after the program is terminated...

       return 0;
    }
    catch(Exception)
    {
        return 3;
    }
    

    }

  • Mike (unregistered) in reply to Just a girl
    Just a girl:
    Jonah:
    try { ... } catch(Exception) { return 3; }
    A new design pattern is born! From now on, I'm going to use this in all my functions.

    Kinda funny... looks like C++ to me. In C++, return 0; immediately terminates an application. Not sure what kinda exception he's trying to catch after the program is terminated...

       return 0;
    }
    catch(Exception)
    {
        return 3;
    }
    

    }

    1. c#, not c++
    2. c++ immediately terminates if you return from a main loop, you can return 0 from any other function you want and not have it die
    3. if it -does- hit an exception, it'll certainly do it before the return 0, and execute the return 3 in the catch
  • B Champlin (unregistered) in reply to Victor Noble

    No, "D7->" is an easier key sequence for the retarded than "dd".

Leave a comment on “The Lesser Date”

Log In or post as a guest

Replying to comment #:

« Return to Article