- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
That's Awesome
Admin
Format$ > Date$.
First?
Admin
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>
Admin
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?
Admin
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?
Admin
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?
Admin
Forget the wtf of it - I respect anyone who can find something like this - kudos!
Admin
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!
Admin
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?
Admin
Did the person who finally figured out this bug fall over laughing after the discovery cause I would have.
Admin
Anonymous was obviously making a reference to the Unix model.
In that model, an ordinary application is any running without super-user/root status.
Admin
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.
Admin
<FONT face=Georgia>And I thought that HPC stood for Hydrometeorological Prediction Center. I stand corrected...</FONT>
<FONT face=Georgia>>BiggBru</FONT>
Admin
We have a test procedure which involves changing the system date so that a time sync can be verified...
Admin
It screws up on the 13th of the month? I guess Friday the 13th really is cursed...
Admin
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?
Admin
Well, it's another multiple-level one, isn't it?
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.
Admin
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
Admin
Luddites expressed dismay at losing their livelihoods by sabotaging machinery. So what are you saying?
Admin
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!
Admin
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" )
Admin
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.
Admin
What do you think the command "date" does in both unix shells and DOS/Windows command line?
ok
dpm
Admin
Yay Americans!
Admin
Im glad Im not using it
Admin
We use YYYY-MM-DD. It's the law, obey it.
http://www.cl.cam.ac.uk/~mgk25/iso-time.html
Admin
When WTF applications like this change it to a wrong value.
ok
dpm
Admin
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.
Admin
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.
Admin
> 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
Admin
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.
Admin
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.
Admin
File this one under, "Evil things to do before leaving my job!"
Admin
$ 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
#
Admin
I use this because it sorts alphabetically.
Admin
quite possibly the best post I have read in a long time!
Admin
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?
Admin
Windows
Designed by Users
Built by Children
Marketed by Atilla the Hun
And what about how all this turned out surprises you?
Admin
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?
Admin
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.
Admin
What's your point? I was discussing the name, not whether the usage is restricted.
ok
dpm
Admin
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.
Admin
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;
}
Admin
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"
Admin
Admin
While the Yuro way still has the order of magnitudes reversed, at least we're not mixing up the magnitudes!
Admin
Volapük! Mans bals, everybody!
Admin
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...
Admin
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.
Admin
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.