- 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
I'm just going by precedent--the seven day week predates both the Julian and Gregorian calendars and is provably unbroken back to at least AD 79. (There's graffiti in Pompeii which lists a day/date pair which matches the current cycle, modulo various details.) It's the main thing that's gotten in the way of modern calendar reform efforts--365~1 mod 7, which means that the ultimate goal of having only one, endlessly reusable calendar will require either moving the Earth or breaking the week cycle, and people seem pretty attached to the week cycle, being historically perfectly willing to change the year count or the year boundary, or even to drop days.
As for its origins, yes, it pretty clearly comes from the "planets" (quotes as the Greek definition of the word, which includes the Sun and Moon, is required here). It goes back at least to Ptolemaic Egypt, and possibly all the way back to Babylon.
Admin
I know it's late, but this wtf inspired me today in sql (MS sqlserver): if datepart(d,@time1) <> datepart(d,@time2) .... to tell if the interval @time1 @time2 straddles midnight
Admin
[quote user="MrsPost There's ever only going to be one time when the singular is used [/quote]
Because that code uses pre-assumption, that English is th only language. Be it proper i18sed, you'd have to care, for example, for Russian.
One form is used for 1, 21, 31...91 Second form is used for 2-4, 22-24, 32-34.. Plural is used for the rest and for 11-19.
Hundreds are irrelevant, at least cannot find counter-examples.
So, as of equal opportunities and world-wide politcorrectness, this site was caught redhanded, uc :-)
Admin
I'd guess it's derived from a technique to find out if a date is the last day of the month, by checking if the following day is in a different month.
Maybe he knows something we dont? Like "them" making dates metric?
Admin
Erm ... if you're flagging the year as "correct" because it's 99 then you've just succumbed to the Y2K bug in your Y2K bug checker. 4 digit years only! Well, until 9999 ...
Anyway, I never said it was an effective check. Just that I'd seen it done this way before :)
Admin
What if first day of decembre is 0, not 1 ? Last day of december won't be 31, but 30... So not only this code is future-proof, it's also platform independant :)
Admin
TRWTF is anyone thinking they "had good reasons for choosing VB".
VB is not a language intended for serious use.
Admin
goatse !
Admin
BTW according to VB documentation, date representation, that can be assigned to Date type relies on local settings. So, 12/31/01 can be also 31/12/01 and 01/12/31
Admin
When the bug ticket comes in, just ignore it for 24 hours and then you don't have to fix it.
Admin
there is no day after the very last one - so he forgot the null check!
Admin
TRWTF is choosing VB over C.
Admin
That is actually a trick I use in T-SQL fairly often. Given a datetime value which is 01/MM/YYYY, you can just do "datetimevar - 1" to get the last day of the previous month because internally a date is an int. Sure, you could use the longer (better documented) dateadd(dd, datevar, -1), function but I prefer the former shorthand way. I do comment in WTF the -1 is doing though for the uninitiated.