- 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
frist, let's do a calculation: $CURRENT_YEAR - 999 = 1025. If that counts as "within the last 2,000 years or so", why doesn't Remy loan me $ 2,000 and I pay him $ 1,025 back?
Admin
to add zero's in front of a number, use: right$("0" + day$,2)
that's how I did it 40 years ago, when GW-Basic was still cutting edge technology. I had hoped we had come some way since then, but apparently not.
Admin
Admin
only if you are using the Gregorian or Julian calendar
Admin
@DQ: Evidently dates are hard. Who knew?
Admin
In my experience, they aren't close to that easy.
Admin
The "S" in CodeSOD means "Snippet", not "Sample", according to the description at the top of this page: https://thedailywtf.com/series/code-sod
lol
Admin
I thought that a CodeSOD was a "Code Snippet of The Day" as mentioned at https://thedailywtf.com/series/code-sod
Admin
@Sauron You beat me to it!
Admin
I tend to think of CodeSOD as meaning code that should sod off, in British slang.
Admin
The worst bit is, the way you format dates is to pass the format string to ToString. The overload is RIGHT THERE and likely shown in the IDE's popup.
Admin
And how about localised date strings ... yyyyMMdd, MMddyyyy, ddMMyyyy and other variants
Admin
So, uh, "86" on StringOfToday()?
Any respectable restaurant would take that off the menu, and fast!
Admin
Everyone knows the "right" way to do this is with an XML transform. Of course!
Admin
I also thought this, TBH.
Admin
Well, Remy was using the Gregorian calendar so I kept in sync.
Admin
The original code is by an amateur.
Everyone knows that the correct way to WTF a date to string function is to use ToString and then substring to pull out the required bits...
Admin
Buffer overflows give me heartburn.