Comment On Long Distance DATE$ing

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 ... [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5Next »

Re: Long Distance DATE$ing

2006-07-12 13:43 • by Joe
That's Awesome

Re: Long Distance DATE$ing

2006-07-12 13:43 • by Looce
Format$ > Date$.



First?

Re: Long Distance DATE$ing

2006-07-12 13:47 • by osp70

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>


 

Re: Long Distance DATE$ing

2006-07-12 13:48 • by Georges P.
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?

Re: Long Distance DATE$ing

2006-07-12 13:53 • by Ken
81282 in reply to 81281

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? 

Re: Long Distance DATE$ing

2006-07-12 13:55 • by Marc
81283 in reply to 81281
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?

Re: Long Distance DATE$ing

2006-07-12 13:58 • by snoofle
81284 in reply to 81281
Forget the wtf of it - I respect anyone who can find something like this - kudos!

Re: Long Distance DATE$ing

2006-07-12 13:59 • by Colin
81285 in reply to 81281
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!

Re: Long Distance DATE$ing

2006-07-12 14:00 • by 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?

Re: Long Distance DATE$ing

2006-07-12 14:02 • by APAQ11
81288 in reply to 81286
Did the person who finally figured out this bug fall over laughing after the discovery cause I would have.

Re: Long Distance DATE$ing

2006-07-12 14:02 • by Rick
81289 in reply to 81282
Anonymous was obviously making a reference to the Unix model.

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

Re: Long Distance DATE$ing

2006-07-12 14:04 • by Krenn
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.

Re: Long Distance DATE$ing

2006-07-12 14:06 • by BiggBru
Alex Papadimoulis:

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



And I thought that HPC stood for Hydrometeorological Prediction Center. I stand corrected...


>BiggBru

Re: Long Distance DATE$ing

2006-07-12 14:10 • by DaveE1
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...

Re: Long Distance DATE$ing

2006-07-12 14:11 • by jspenguin
It screws up on the 13th of the month? I guess Friday the 13th really is cursed...

Re: Long Distance DATE$ing

2006-07-12 14:12 • by Mark H
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?

Re: Long Distance DATE$ing

2006-07-12 14:14 • by Dazed
81296 in reply to 81286
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.

Re: Long Distance DATE$ing

2006-07-12 14:20 • by dpm
81297 in reply to 81283
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

Re: Long Distance DATE$ing

2006-07-12 14:20 • by ping 255.255.255.255
81298 in reply to 81285
Luddites expressed dismay at losing their livelihoods by sabotaging machinery.  So what are you saying?

Re: Long Distance DATE$ing

2006-07-12 14:20 • by 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!


 

Re: Long Distance DATE$ing

2006-07-12 14:25 • by Sizer
81300 in reply to 81282
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" )

Re: Long Distance DATE$ing

2006-07-12 14:26 • by Pete
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.

Re: Long Distance DATE$ing

2006-07-12 14:26 • by dpm
81302 in reply to 81296
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

Re: Long Distance DATE$ing

2006-07-12 14:27 • by treefrog
81303 in reply to 81299
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!

Re: Long Distance DATE$ing

2006-07-12 14:27 • by Steeldragon
81304 in reply to 81301
Im glad Im not using it

Re: Long Distance DATE$ing

2006-07-12 14:28 • by ISO
81305 in reply to 81299
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

Re: Long Distance DATE$ing

2006-07-12 14:28 • by dpm
81306 in reply to 81301
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

Re: Long Distance DATE$ing

2006-07-12 14:30 • by My Name
81307 in reply to 81286
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.

Re: Long Distance DATE$ing

2006-07-12 14:31 • by HitScan
81308 in reply to 81294
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.

Re: Long Distance DATE$ing

2006-07-12 14:34 • by Pete
81309 in reply to 81299
> 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

Re: Long Distance DATE$ing

2006-07-12 14:34 • by Chaim79
81310 in reply to 81297

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.


 

Re: Long Distance DATE$ing

2006-07-12 14:36 • by Walrus
81311 in reply to 81305
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.

Re: Long Distance DATE$ing

2006-07-12 14:36 • by Benedict Arnold
File this one under, "Evil things to do before leaving my job!"

Re: Long Distance DATE$ing

2006-07-12 14:40 • by My Name
81313 in reply to 81302
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

#


Re: Long Distance DATE$ing

2006-07-12 14:40 • by Anonymous
81314 in reply to 81305
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.

Re: Long Distance DATE$ing

2006-07-12 14:40 • by larrabee
quite possibly the best post I have read in a long time!

Re: Long Distance DATE$ing

2006-07-12 14:52 • by kalasz
81316 in reply to 81311
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?

Re: Long Distance DATE$ing

2006-07-12 14:52 • by Ford351-4V
81317 in reply to 81286
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?

Re: Long Distance DATE$ing

2006-07-12 14:58 • by Dazed
81318 in reply to 81308
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?

Re: Long Distance DATE$ing

2006-07-12 15:00 • by Also Anonymous
81319 in reply to 81316
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.

Re: Long Distance DATE$ing

2006-07-12 15:00 • by dpm
81320 in reply to 81313
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

Re: Long Distance DATE$ing

2006-07-12 15:04 • by Thomas from Europe
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.

Re: Long Distance DATE$ing

2006-07-12 15:06 • by Compulsion
81322 in reply to 81282
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;
}

Re: Long Distance DATE$ing

2006-07-12 15:07 • by Johnny Gore
81323 in reply to 81318
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"



Re: Long Distance DATE$ing

2006-07-12 15:09 • by Dirk Squarejaw
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.

Re: Long Distance DATE$ing

2006-07-12 15:10 • by Hubert Farnsworth
81326 in reply to 81299
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!

Re: Long Distance DATE$ing

2006-07-12 15:11 • by Last Bubble
81327 in reply to 81318

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!

Re: Long Distance DATE$ing

2006-07-12 15:12 • by xix
81328 in reply to 81321
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...

Re: Long Distance DATE$ing

2006-07-12 15:13 • by NateB2

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.


 

Re: Long Distance DATE$ing

2006-07-12 15:17 • by Bus Raker
81330 in reply to 81286

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.  

« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5Next »

Add Comment