- 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
DATE$ is a very old "legacy" statement that was carried forward from IBMs "BASIC" language that was available in XT's ROM. The statement read and wrote directly to the CMOS's real time clock. It was a friendly way to get/set the date rather than making interupt calls.
Backward compatibility brought the old DATE$ command through the 80s in MS-DOS's "QuickBASIC". Still useful for avoiding interrupt calls. BASIC commands still required the datatype-declarator "$" for strings.
Backward compatibility and friendliness brought the DATE$ command into VB3. The "$" became optional, but, the spirit lived on. You could still get/set the CMOS through this friendly manner. Or you could script SENDKEYS commands to launch Control Panel and strong-arm the control panel applet to set the time/date. Or you could call the WinAPI, but, the BIOS call is gone.
VB4 continued the DATE$ compatibility-friendliness.
VB6 carries the tradition.
VBA, sitting ontop of VB6 imortalizes the "interrupt macro"
Admin
Unix is no different. I can reboot any unix box that I have physical access to, but I can't set the date.
in unix, it can print out the date in local or UTC form, or it can set the date (with root privs). Speaking of unix, dd - what sort of intuitive name is that? You know why it's called dd, right? cc was already taken. Don't even get me started about makefiles.
Admin
Long form date: December 7, 1942
== 12 7, 1942
== 12/07/1942
== MM/DD/YYYY
Is long form different in Europe?
-me
Admin
In Europe, well the UK anyway, the lonog format would be
7th December, 1942
Admin
I assume the actual contents of $DATE afterwards is the system date at the time you access it - so you get back the date you put in, as long as you don't wait too long to look.
Of course, the real WTF is that what looks like ordinary variable access has such nasty side-effects. In some ways, it's even more evil than warped use of operator overloading. Also, if I'm understanding this correctly, you can set just the date without changing the time (and presumably vice-versa) - can anyone say "race condition"?
Admin
as soon as y'all stop describing how much people weigh using "stones" (WTF is that, anyway?) then we can talk about the metric system.
as for fahrenheit -- it runs from intolerably cold at 0 degrees to intolerably hot at 100. we won't be losing that for some arbitrary system based on chemistry any time soon.
Admin
Yup. VBA is fine for login scripts and such... but...
The real WTF is that VBA was used to create an application. VBA stand for Visual Basic FOR Applications, and in this case the for does NOT mean FOR CREATING. It means TO ASSIST. Basically, it's a scripting language to add scripting functionality to an application.
This submission doesn't surprise me the least bit. A person used VBA to create an application. The fact that they made that decision renders all other decisions they make questionable.
Admin
Unix systems are different, in that *usually* users do _not_ have physical access to the actual computer. Windows of course is the opposite.
ok
dpm
Admin
Public Sub ChangeSystemDate(newDate as date)
Application.Fabulous = True
Date$ = newDate
Application.Fabulous = False
End Sub
Admin
Don't be so quick with the NOOB! Having a programming project in 5th grade? You're pretty young yourself. I didn't stumble on a PC in my school til 7th grade, and didn't have a class with it til junior or senior year.
Captcha: CRAPTASTIC
Admin
The real WTF is how few people use ISO standard dates. 20060712 forever!
Admin
I think what he means by ordinary is an application that is running with user privileges as opposed to administrator/root privileges. This does make sense, and might already be true for *nix systems, or maybe *nix systems have user time and system time..... I dunno. I never really looked into it.
Admin
You know what I think the real WTF is? That Microsoft lets an unprivilaged script in the user space do something like setting the system date. Don't believe that is a problem? Reread the post.
Admin
It's a double sided error... my personal favorite...
1. Always assume that Date, Time, Today, System, Unit, Print ... etc are reserved words.... if it capitalized it for you, and you don't have it defined, it's not yours.
2. Why would VBA need system time write access with a variable? Stupid to me.
but, both the programmer of VBA and the Programmer of this App must be at about the same level.
Admin
Well, it's close. Your HPC can tell you the chances of rain in the near future. Being aware of the other HPC's engagement can tell you there's a good chance it will rain shit in the near future.
</font>
Admin
C:\>date /?
Displays or sets the date.
DATE [/T | date]
Type DATE without parameters to display the current date setting and
a prompt for a new one. Press ENTER to keep the same date.
If Command Extensions are enabled the DATE command supports
the /T switch which tells the command to just output the
current date, without prompting for a new date.
Admin
<sarcasm>
NO WAY! That is TOTALLY not the WTF! Microsoft is the #1 best software company of all time! They NEVER make anything without thoroughly thinking through ALL ASPECTS, and then they ALWAYS produce SOLID, STABLE, MAITENENCE FREE products that should cost AT LEAST 1000x what they charge! Microsoft would NEVER violate the buyer's trust by supplying them with INFERIOR, INSECURE, BUGGY, BLOATED, UNSTABLE crap at a higher cost.
</sarcasm>
lol...
Does anyone even expect microsoft to implement a proper priviledge system in Vista? Or document it well for that matter? I know I don't... I expect that to be happening around 2020, assuming Microsoft is still around, but that's just me... Yeah, Microsoft needs to get their act together when it comes to their OS.
Admin
"Tolerable" is relative. I just came back from lunch, and it's something like 118° outside, and scheduled to top 125°, but at about 4% humidity. I can tolerate that. Transplant me somewhere that's only 90° and 50%+, and I can't breathe; I call that intolerable. The point is, they're both arbitrary systems. What's wrong with using the one that's closer to "absolute" numbers?
I propose a new system, because the '°' is too difficult to type: The freezing temperature of beer will be called 'a', while the temperature inside the car after 6 hours in the July sun will be "z."
And just to finish stirring the shit-pot, I'm American, I prefer the metric system, and I tend to write dates as yyyy-mm-dd because there's little chance of mistaking it.
Admin
does Logo still exist?
Admin
Actually, you didn't even need the manual. I learned all of the GWBASIC that I knew for a long time by holding Control and htting a letter, and it would spell it out automatically. Then add params and see what breaks/works. I figured out almost all of the common use stuff, but never did know how to use graphics until I got ahold of some basic shareware.
That's real discoverability. And it's got a snoball's chance in hell of ever coming back. :(
Admin
<sarcasm>
Wait a second! Are you insinuating that keeping my $500 grafix card running at full throttle all the time so that I can have a wicked cool 3d desktop is *less* important than increasing stability, fixing bugs and improving security? NO WAY!
</sarcasm>
Admin
Admin
In old BASICs it didn't matter, because strings had to be suffixed with $. You could easily use if$, then$, rem$ and whatnot, so long as the reserved word didn't also have a $, such as date$ and input$ (there may have been a print$, but it's been too long for me to remember.) You could also use % for ints (I think) and I believe that every reserved word would work with that, and whatever the float/long/etc suffixes were.
Double check the FP, he used Date$, not Date. All prior experience would point to it working perfectly, unless you knew about it's special function.
Admin
perl. But then again, I was never very good with children.
Admin
I would have difficulty breathing at 4% humidity regardless of the temperature :\
Admin
1: You seem to have misslabeled the quote, as I didn't make that post. :)
2. Yes, but I don't know how popular it is. There's a Logo available from the KDE project, and I think there are some versions available for Windows, but I've not really thought much about it since '92-'93. Honestly, I learned more from messing around with a text mode BASIC than I did from Logo (that may have as much to do with the Logo teacher as it does the language though.) MS should have kept QBasic hidden someplace in \Windows\whatever\ because it's built in help really helped me learn how to make the most of it. Also, text based languages are vastly easier to get started in. QB hello world can be 1 line, but it's a shitload more in Win32 or even VB.
Admin
YYYY-MM-DD, isn't it the best way to store dates? If in clear text, isn't it easier to sort? Go USA! Go Go Go!
Admin
It does. For some reason, though, it is considered perfectly normal to use Windows computers logged in as an administrator.
Also, there's more than one 'European date format'. The UK and Ireland tend to use DD/MM/YYYY, while on the continent YYYY-MM-DD seems more common.
Admin
The real WTF is people who are seemingly intelligent enough to comprehend the WTFs, while not being smart enough to look into even the basics of Windows security as it has been for over 13 years!
While the ability to configure what users have the right to change the system clock has been around since the first version of Windows NT in 1993, the interface was changed in 2000. Go to Administrative Tools|Local Security Settings|Local Policies|User Rights Assignment, and look for the right called "Change the system time". By default administrators and power users have the right, and most users run as power users or administrators by default, so most users always have the ability to change the time.
What Vista introduces is the ability to assign rights separately for changing the clock and changing the time zone. That way a laptop user can be prevented from screwing up their clock while still being able to tell their computer what time zone they have most recently traveled into.
The only way to allow a Unix user to change the time is to give them complete 100% control over the machine. Or you could write an suid root program that has a non-standard way of assigning rights, and hope that you're a good enough suid programmer that you didn't just create a privilege elevation attack waiting to happen.
Admin
Python springs to mind. And logo.
Admin
SuCk
Come on lets see some good wtfs!
i want code!!! and really bad code (no vb, and no db crap)
Admin
God, I remember the F.I.S.T. system. Those punchcards were a pain.
Admin
I'd do it in C, where it OBVIOUSLY isn't reserved. Well, in practice I'd probably be cautious, but there's no huge reason why I SHOULDN'T.
Admin
And it's remarks like these that make us want to have as little as posibble to do with the US.
The fact that you still haven't figured this out after 514 years, is a genuine WTF.
Admin
Emphasis added
Admin
That particular oddity is just for the UK and Ireland, where we continue to cling onto some of the vestiges of the Imperial system.
Admin
Scripts should not be run as Admin/Root.
even my home media linux box, I setup seperate accounts for the Fax software, Apache, DVR emulators, TFTP server, and my user desktop. Would have been easier to run it all as root in some ways; But seperating them allowed me to understand and control them much more effectivly. (I also learned IPTables! fun!)
Software will have bugs; but allowing those bugs to contaminate other systems in uncontrolled ways is a seperate issue. (I hate the Java language, but I love the Java VM)
Admin
The only thing I know is that a woman who weighs in at 19 of 'em is a Whole Lotta...Something Something.
Admin
As I said before, yes, that's the correct way. If only some people would accept ISO's authority as the world standards organization... but nooo, let's continue measuring length in how long parts of your body are, rather than something that actually makes sense. Lots of ISO units fit together in a manner (for example, one cubic meter is 1000 liters, and that much water weighs about 1000 kilograms).
Even without that, don't you think it's of some value to have ONE and ONLY ONE standard for things?
Admin
I am two weiners tall.
Admin
Well, in the Netherlands, YYYY-MM-DD is hardly ever used, besides by people clever enough to understand that YYYY-MM-DD sorts nicely when sorting alphabetically, but generally in forms, letter headers, receipts etc its all DD-MM-YYYY
Admin
Another solution for them would just to print all forms once a month.
On the first of Januray
On the second of February
On the third of March
And so on... Then there is no issue.
Admin
The system clock is just the tip of the iceberg.
The real WTF is people who are seemingly intelligent enough to comprehend the intricacies of the windows system clock, while not being smart enough to observe commenting on the fundamental flaws in Windows security as it has been for over 13 years!
Insulting others' intelligence is never a nice thing to do, unless it's their code that was posted ;-P
Admin
We even use DD. MM. YYYY here. Looks nicer than these ugly slashes, doesn't it?
It does what you are expecting it to do, doesn't it? If you don't give it an argument, you get the current time, if you do, you change the time. But $ date = 2005-06-07 certainly won't work.
Captcha: genius. I feel flattered...
Admin
I have yet to meet a temperature scale that is based on chemistry.
Celsius is based on physics.
Admin
What about command line C#?
Admin
If your spreadsheet maintained a list of holidays then your macro would know to subtract two days instead of 1. How in the world do you handle weekends with this method?
Admin
Actually Celsius was defined using the specific heat of water. Specific heat was originally a chemistry metric.
Admin
Do you play piano? My wife keeps telling me she is looking for a 10 inch pianist.
Admin
Whoever decided to call the SetSystemDate function simply DATE had very little programming experience. Descriptive naming anyone?
Of course the ISO date format is the most logical. The most significant digit gotta come first -- 523 is not Three Hundred and Fifty Two. In most cases it doesn't matter too much, but... have you ever tried to use MM-DD-YYYY in file names? In a file system the YYYY-DD-MM format is mandatory, or else you simply can't sort by name!
Tom