• Joe (unregistered)

    That's Awesome

  • Looce (unregistered)

    Format$ > Date$.

    First?

  • (cs)

    I'll say it because undoubtably someone will say it....

    If they used anything but vb then this wouldn't have happened, because only monkeys need to use VB.

    </sarcasm>

     

  • Georges P. (unregistered)

    Wouldn't it be great if an ordinary application did not have the privilege of changing the system's date? Can you dare to imagine such a revolutionary concept?

  • (cs) in reply to Georges P.

    Anonymous:
    Wouldn't it be great if an ordinary application did not have the privilege of changing the system's date? Can you dare to imagine such a revolutionary concept?

    An *ordinary* application?  What exactly entails an *ordinary* application?

    And what would do if you DID need to change the system date?  Set ExtraOrdinary = True? 

  • Marc (unregistered) in reply to Georges P.
    Anonymous:
    Wouldn't it be great if an ordinary application did not have the privilege of changing the system's date? Can you dare to imagine such a revolutionary concept?


    Since the end-users had to reboot to fix their clocks, I can only assume they didn't have access to change the date through the normal control panel.

    So they could change it through an application, but not through the panel... another WTF?
  • (cs) in reply to Georges P.

    Forget the wtf of it - I respect anyone who can find something like this - kudos!

  • Colin (unregistered) in reply to Georges P.
    Anonymous:
    Wouldn't it be great if an ordinary application did not have the privilege of changing the system's date? Can you dare to imagine such a revolutionary concept?


    Your crazy high-tech solution would put at least one consultant out of a job because he couldn't handle dates.  Please think of these consultants before spewing your anti-luddite doctrine!
  • (cs)

    The real WTF is that there is a command to change the system date in VBA.

    So who can come up with a scienario where a spreadsheet, word doc, or access app needs to change the time on the local pc?

  • APAQ11 (unregistered) in reply to DigitalLogic

    Did the person who finally figured out this bug fall over laughing after the discovery cause I would have.

  • (cs) in reply to Ken

    Anonymous was obviously making a reference to the Unix model.

    In that model, an ordinary application is any running without super-user/root status.

  • Krenn (unregistered)

    Ye gods, I can feel the pain the support teams (and the users) went through on that one like a kick in the crotch.  What a nightmare.

  • (cs)
    Alex Papadimoulis:

    All was well until a HPC (Highly Paid Consultant) ...

    <FONT face=Georgia>And I thought that HPC stood for Hydrometeorological Prediction Center. I stand corrected...</FONT>

    <FONT face=Georgia>>BiggBru</FONT>

  • (cs)
    Alex Papadimoulis:

    Mot did a pretty good job in telling this tale of Long Distance DATE$ing, so I'll just turn it on over to him ...

    VBA has a DATE$ command, used to set the workstation date. Why you would want to reset the workstation's date is left to your imagination, but the command is documented in the help.




    We have a test procedure which involves changing the system date so that a time sync can be verified...
  • (cs)

    It screws up on the 13th of the month? I guess Friday the 13th really is cursed...

  • Mark H (unregistered)

    Great submission. I am also very impressed that you tracked down that bug. Of course, it's hard to take it so seriously when I read, "nested in 5 gosubs"...The last time I used a language with a gosub construct was 5th grade when I wrote "CSH_RGST.BAS" (that's "cash register" for you noobs) for a project.

    So if I undertand this correctly, in VB a simple assignment of the form

    DATE$ = xyz

    can have a side-effect such as changing the system clock? But it also behaves like a regular assignment, putting the value of xyz into DATE$? What a crazy environment to work in. I mean you can do the same in C++ and I hear its very easy to do in .NET also, but I've never heard of it being built-in to the API.

    PS the captcha dictionary has like, maybe 10 words in it. how many times have i gotten poprocks?

  • Dazed (unregistered) in reply to DigitalLogic
    DigitalLogic:
    The real WTF is that there is a command to change the system date in VBA.

    So who can come up with a scienario where a spreadsheet, word doc, or access app needs to change the time on the local pc?

    Well, it's another multiple-level one, isn't it?

    • that the command exists at all;
    • that it isn't called something sensible like SET_SYSTEM_DATE, or at least SETDATE;
    • that Windows doesn't have a proper security system to prevent arbitrary apps doing this sort of thing;
    • that the dates on the forms were hardcoded in American format in an app shipped to Europe;
    • ...

    I do actually know of one European company that, when the third release of a bespoke American-written app still had hardcoded American dates, had the guts to kick them out. It should happen more often.

  • (cs) in reply to Marc
    Marc:
    Since the end-users had to reboot to fix their clocks, I can only assume they didn't have access to change the date through the normal control panel.

    That says a lot about Windows WTFery, right there:  the user has the ability to reboot the machine but not set the clock.  Story!

    ok
    dpm
  • ping 255.255.255.255 (unregistered) in reply to Colin

    Luddites expressed dismay at losing their livelihoods by sabotaging machinery.  So what are you saying?

  • Hexar (unregistered)

    The Real WTF(tm) is that Europe uses DD/MM/YYYY for dates.  Which is kinda like saying The Real WTF is that the rest of the world uses the metric system.  Go USA!

     

  • Sizer (unregistered) in reply to Ken
    Ken:

    Anonymous:
    Wouldn't it be great if an ordinary application did not have the privilege of changing the system's date? Can you dare to imagine such a revolutionary concept?

    An *ordinary* application?  What exactly entails an *ordinary* application?

    And what would do if you DID need to change the system date?  Set ExtraOrdinary = True? 



    I think anything in VBA qualifies as an ordinary application that shouldn't be messing with the system date. And certainly not with this little effort. Perhaps:

        Watch_Out_I_Am_Setting_The_System_Date_Of_The_Entire_Machine( "02/35/2006" )

  • Pete (unregistered)

    What reason could any non-administrative application have to change the date?
    I've seen certain Systems and Setups where you need administrative privileges to change date and time and it makes total sense to me. If it actually needs to change the date and time it better be an admin running it. This said it's only clear that the problem is not VBA or VB, but the underlying OS.

  • (cs) in reply to Dazed
    Dazed:

    - that it isn't called something sensible like SET_SYSTEM_DATE, or at least SETDATE;

    What do you think the command "date" does in both unix shells and DOS/Windows command line?

    ok
    dpm
  • (cs) in reply to Hexar
    Anonymous:

    The Real WTF(tm) is that Europe uses DD/MM/YYYY for dates.  Which is kinda like saying The Real WTF is that the rest of the world uses the metric system.  Go USA!

     


    Yay Americans!
  • (cs) in reply to Pete

    Im glad Im not using it

  • ISO (unregistered) in reply to Hexar
    Anonymous:

    The Real WTF(tm) is that Europe uses DD/MM/YYYY for dates.  Which is kinda like saying The Real WTF is that the rest of the world uses the metric system.  Go USA!

    We use YYYY-MM-DD. It's the law, obey it.

    http://www.cl.cam.ac.uk/~mgk25/iso-time.html

  • (cs) in reply to Pete
    Pete:
    What reason could any non-administrative application have to change the date?

    When WTF applications like this change it to a wrong value.

    ok
    dpm
  • My Name (unregistered) in reply to DigitalLogic
    DigitalLogic:
    The real WTF is that there is a command to change the system date in VBA. So who can come up with a scienario where a spreadsheet, word doc, or access app needs to change the time on the local pc?


    And the day will dawn when you want to write your fist system administration tool in Excel. Don't cry when you recognize that this function is missing.
  • (cs) in reply to Mark H
    Anonymous:
    Great submission. I am also very impressed that you tracked down that bug. Of course, it's hard to take it so seriously when I read, "nested in 5 gosubs"...The last time I used a language with a gosub construct was 5th grade when I wrote "CSH_RGST.BAS" (that's "cash register" for you noobs) for a project.

    So if I undertand this correctly, in VB a simple assignment of the form

    DATE$ = xyz

    can have a side-effect such as changing the system clock? But it also behaves like a regular assignment, putting the value of xyz into DATE$? What a crazy environment to work in. I mean you can do the same in C++ and I hear its very easy to do in .NET also, but I've never heard of it being built-in to the API.

    PS the captcha dictionary has like, maybe 10 words in it. how many times have i gotten poprocks?


    It exists because of brain damaged backward compatability. It used to be halfway useful in BASICA and GWBASIC when you were using machines that ran DOS, and could make halfway usable applications in a basic language.

    There was no good reason whatsoever though to put it in VBA. VB1.0 for DOS? OK, I can see that, I guess. But not VBA, which didn't even exist until GWBASIC was long dead. (Did this trick work in QBasic? I wouldn't guarantee it.)


    That said, it's hard to blame the consultant for the WTF as a whole since it was undectable from their (and the original users in the US) POV, though he does earn some harsh WTFery over the use of GOSUB.
  • Pete (unregistered) in reply to Hexar

    > The Real WTF(tm) is that Europe uses DD/MM/YYYY for dates.  Which is kinda like saying The Real WTF is that the rest of the world uses the metric system.  Go USA!

    You know... it makes more sense to have smallest/medium/largest time value than it does having medium/smallest/largest? Of course, largest/medium/smallest would make the most sense in terms of easy parseability

  • Chaim79 (unregistered) in reply to dpm

    dpm:
    Marc:
    Since the end-users had to reboot to fix their clocks, I can only assume they didn't have access to change the date through the normal control panel.

    That says a lot about Windows WTFery, right there:  the user has the ability to reboot the machine but not set the clock.  Story!

    What was going on there is that the machine date was being set by the program, but on bootup the machine would update the date/time from a server. (note the very last part of the artical). That has nothing to do with the WTF other then it's an easy(?) way to get the date corrected.

     

  • (cs) in reply to ISO
    Anonymous:

    We use YYYY-MM-DD. It's the law, obey it.

    http://www.cl.cam.ac.uk/~mgk25/iso-time.html



    Why would anyone want their date displayed like that? Internal storage fair enough, but why can't we just use the system to format the date for UI? Does Format$(date, "Long Date") not work in VBA?

    Nothing like a hardcoded format, be it USA, Euro or ISO to annoy users.
  • Benedict Arnold (unregistered)

    File this one under, "Evil things to do before leaving my job!"

  • My Name (unregistered) in reply to dpm
    dpm:
    Dazed:

    - that it isn't called something sensible like SET_SYSTEM_DATE, or at least SETDATE;

    What do you think the command "date" does in both unix shells and DOS/Windows command line?


    $ date
    Wed Jul 12 20:35:47 CEST 2006
    $ date -s 2006-11-11
    date: cannot set date: Operation not permitted
    Sat Nov 11 00:00:00 CET 2006
    $ su
    Password:
    # date -s 2006-11-11
    Sat Nov 11 00:00:00 CET 2006
    #

  • Anonymous (unregistered) in reply to ISO
    Anonymous:
    Anonymous:

    The Real WTF(tm) is that Europe uses DD/MM/YYYY for dates.  Which is kinda like saying The Real WTF is that the rest of the world uses the metric system.  Go USA!

    We use YYYY-MM-DD. It's the law, obey it.

    http://www.cl.cam.ac.uk/~mgk25/iso-time.html



    I use this because it sorts alphabetically.
  • larrabee (unregistered)

    quite possibly the best post I have read in a long time!

  • kalasz (unregistered) in reply to Walrus

    Well... in my country we use YYYY. MM. DD. It's our system, it's our habit. It is at least logical than DD/MM/YY.

    Notice that the YYYY. MM. DD. format contains ordinals - one should read it as 2006th year, 7th month, 12th day. Logical, isn't it?

  • (cs) in reply to DigitalLogic
    DigitalLogic:
    The real WTF is that there is a command to change the system date in VBA.

    So who can come up with a scienario where a spreadsheet, word doc, or access app needs to change the time on the local pc?


    Windows

    Designed by Users
    Built by Children
    Marketed by Atilla the Hun

    And what about how all this turned out surprises you?

  • Dazed (unregistered) in reply to HitScan
    HitScan:
    It used to be halfway useful in BASICA and GWBASIC ...

    Leaping off onto another subject entirely ... Back in those days you could point a child at BASIC and let him play with it a bit to get a feel of what a program was. The manual was about 3 pages, and you could write a simple program in half-a-dozen lines.

    Now that languages come with multi-megabyte SDK's, 600-page manuals, and it takes ten classes to say Hello World, what language can one offer to children to play around with?

  • Also Anonymous (unregistered) in reply to kalasz
    Anonymous:
    Well... in my country we use YYYY. MM. DD. It's our system, it's our habit. It is at least logical than DD/MM/YY.

    Notice that the YYYY. MM. DD. format contains ordinals - one should read it as 2006th year, 7th month, 12th day. Logical, isn't it?


    Haha, you're speaking of logical to Americans? What the  matter with you?
    If it's not the American Way (TM), it's evil, and no Patriotic American will use it, no matter how much it fits the idea of this "logical" you speak of.

  • (cs) in reply to My Name
    My Name:
    dpm:
    Dazed:

    - that it isn't called something sensible like SET_SYSTEM_DATE, or at least SETDATE;

    What do you think the command "date" does in both unix shells and DOS/Windows command line?


    $ date
    Wed Jul 12 20:35:47 CEST 2006
    $ date -s 2006-11-11
    date: cannot set date: Operation not permitted
    Sat Nov 11 00:00:00 CET 2006
    $ su
    Password:
    # date -s 2006-11-11
    Sat Nov 11 00:00:00 CET 2006
    #


    What's your point?  I was discussing the name, not whether the usage is restricted.

    ok
    dpm
  • Thomas from Europe (unregistered)

    This is a typical problem of software shipped from the States to Europe. European users have to worry about something like that since at least 20 years.

  • (cs) in reply to Ken
    Ken:

    Anonymous:
    Wouldn't it be great if an ordinary application did not have the privilege of changing the system's date? Can you dare to imagine such a revolutionary concept?

    An *ordinary* application?  What exactly entails an *ordinary* application?

    And what would do if you DID need to change the system date?  Set ExtraOrdinary = True? 



    No... AllowExtraOrdinaryMeasures is private member of the Singleton "Times".  

    You need to modify the public Times.isExtraordinary flag:

    if(this.isExtraordinary)
    {
      //..calls for extraordinary measures
      AllowExtraOrdinaryMeasures = true;
    }
  • Johnny Gore (unregistered) in reply to Dazed

    Okay, sure, having a function to set the system date, built in to VBA, is a pretty bad idea. They could've at least made programmers use a Win32 API function.

    However, how many programmers here would actually code a statement like this?

    Date = "07/12/2006"

    To even consider using an OBVIOUSLY reserved system word requires you to be pretty messed up in the head. That would be like trying to write:

    String = "some string"

  • Dirk Squarejaw (unregistered)
    A fine, extensible subset and superset of VB commands.
    If something is both a subset and superset of something else, then those two things are equal.
  • (cs) in reply to Hexar
    Anonymous:

    The Real WTF(tm) is that Europe uses DD/MM/YYYY for dates.  Which is kinda like saying The Real WTF is that the rest of the world uses the metric system.  Go USA!

    While the Yuro way still has the order of magnitudes reversed, at least we're not mixing up the magnitudes!

  • Last Bubble (unregistered) in reply to Dazed

    Anonymous:
    HitScan:
    It used to be halfway useful in BASICA and GWBASIC ...
    Leaping off onto another subject entirely ... Back in those days you could point a child at BASIC and let him play with it a bit to get a feel of what a program was. The manual was about 3 pages, and you could write a simple program in half-a-dozen lines. Now that languages come with multi-megabyte SDK's, 600-page manuals, and it takes ten classes to say Hello World, what language can one offer to children to play around with?

    Volapük! Mans bals, everybody!

  • xix (unregistered) in reply to Thomas from Europe

    I use YYYY-MM-DD all the time.  As far as I know, no one ever does YYYY-DD-MM, so if you see a 4 digit year before the first separator, you know what you're doing.

    And, lo and behold, look at times of the day.. HH-MM-SS... most significant to least... so if you put it next to the format above you get a full YYYY-MM-DD HH:MM:SS, it's a good thing.

    So's metric, but we won't be winning that war any time soon... inches and feet, dear lord...

  • NateB2 (unregistered)

    Actually, there is a *small* use for the Date$ function.  In Excel, I have numerous macros that run on certain days, creating files that have a time-date stamp, open files that were made a previous week, etc. On some occasions (like after holidays), I have to set my system clock back and run the macros as if they were running on that day.  This statement makes it it possible to automate that procedure.

    This, of course, is no excuse for the way the Date$ function was used in TDWTF.

     

  • (cs) in reply to DigitalLogic

    DigitalLogic:
    The real WTF is that there is a command to change the system date in VBA. So who can come up with a scienario where a spreadsheet, word doc, or access app needs to change the time on the local pc?

    Almost very login script sets the time programmatically to the time server, and many are written in VBScript in the windows world.

    I would also imagine it could be useful for automated testing purposes,  though everyone knows that VBA apps/tools don't go through any QA ... they are made on the fly by IT people that believe they are programmers and end up on the dailywtf.  

Leave a comment on “Long Distance DATE$ing”

Log In or post as a guest

Replying to comment #81321:

« Return to Article