- 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
My favorite never ending pet project is to write a parser that picks out and parses all dates from some random text, e.g. a web page. Of course I don't expect it to find and parse all correctly, but it is like a competition between a lot of candidates. A part of the project is to come up with some regex extensions suitable for the task.
(Current state is that the project becomes my Moriarty and I am close to Reichenbach Falls.)
Admin
Admin
Admin
Admin
In the summer of 1997 I converted all our software, both input and output, to yyyy/mm/dd. This was in Thailand. Many users complained. I explained that it was necessary for Y2K. They'd all heard of that, so they accepted my changes.
Three years later, I left it that way because I prefer it to the variable mess humans write for dates. Everyone had forgotten the past formats and were used to seeing my better format by that time (for example, it sorts as a string).
As of 2014/04/10 they are STILL using it.
Admin
The real WTF is the stupid way people are able to actually make an easy standard confusing again.
If you want to use the stupid US-WTF-order (MM/DD/YY) then please use the slashes only. BUT by using dashes (like in the ISO standard (YYYY-MM-DD)) in combination with the fucked up order you are just confusing everyone.
Admin
Admin
So they arrive, and what is the local date?
February 30...
http://en.wikipedia.org/wiki/February_30
Admin
Admin
Admin
Unless you use yyyy-mm-dd, then shut up. :-) If you do, then carry on with your rage. If you use anything with the year after the month and date then that's just as bittle endian when you add the time.
Admin
i am tried of seeing articles that have date formatting issue. treat date as dates and not as string or numbers.
Admin
Don't be hating on our dating.
Admin
Double the trouble and trouble the Double.
Admin
Do you mind posting a snippet with this code?
Admin
Never forget 9/11............../1752
Admin
Thats why I wrote locale and not country ;)
But we ended up not letting them choose format at all, we opened a calendar popup where they could click the right date and then no more broken dates.
Admin
Starting to number the month with 0 (and the day of the month too), is the only logical way to do it.
This logic is the reason we use times from 00:00:00 to 23:59:59.
(By the way, any code monkey should be more than familiar with the idea that the FIRST element of an array (we say FIRST, SECOND, etc day. of month, and FIRST, SECOND, etc. month of the year after all) has the index (or number) ZERO.
So TRWTF is our (the humans) custom to number months and days with an offset of one.
Admin
Yeah, I dealt with that last night/early this morning.
Had a DB where month was stored as 0-11, but the datetime constructor in Python uses 1-12. Fun.
Admin
dd-mon-yyyy dd-mon-yy dd/mon/yyyy dd/mon/yy mm/dd/yy mm-dd-yy mm-dd-yyyy dd-mm-yy yyyy-mm-dd
In those rare cases where I had to use literals I would use the yyyy-mm-dd syntax to avoid confusion. I don't know how it decided that this wasn't a subtraction operation.
Admin
I'd be fine with that except the Java API uses 1 for the first day of the month, and 1 for the first year. For months, consistency with year/day is more important than consistency with time.
Admin
typically of Java programmers
Admin
The problem is clearly that the += operator is used to concatenate onto the dateString. Best practices clearly call for the use of StringBuilder in such performance-sensitive applications including repeated string concatenation and exception-handling code.
Admin
Interesting discussion ! I think that one of the most compelling reasons to use YYYY-MM-DD is that it cannot be confused with anything else. Another benefit is that files are automatically sorted in the correct order.