Re:Perl code that is syntactically correct only on Fridays
by ihateolives on Wednesday February 16, 2022 @09:55AM
(#30360728)
I once had to implement date picker that returned the date to be sent to backend to fetch the day's reservations. It seemed to work fine the day I implemented it. Next day it broke. Turned out the widget returned MM/DD/YYYY instead of DD/MM/YYYY.
And I implemented it on 10th of October.
[ Parent
| on HN ]
Re:Perl code that is syntactically correct only on Fridays
by PixelOfDeath on Wednesday February 16, 2022 @11:51AM
(#30362327)
Aliens landed on this planet, found out about the date format MM/DD/YYYY, and left in a hurry. They are currently preparing a gamma ray burst out of pure compassion and pity but also a hint of disgust!
Re:Perl code that is syntactically correct only on Fridays
by Ma8ee on Wednesday February 16, 2022 @02:21PM
(#30364484)
Is that date format used anywhere outside the US? We have always used YYYY-MM-DD. Which is very nice, if for nothing you can use a single string sort if for whatever reason need to sort them.
Re:Perl code that is syntactically correct only on Fridays
by ant6n on Wednesday February 16, 2022 @03:26PM
(#30365224)
In my world, there are two date formats: yyyy-mm-dd and dd.mm.yyyy.
Anything involving a slash is asking for trouble.
Re:Perl code that is syntactically correct only on Fridays
by mark-r on Wednesday February 16, 2022 @01:33PM
(#30363783)
I'm a big fan of ISO 8601. Eliminates the confusion, and sorts lexicographically too.
Re:Perl code that is syntactically correct only on Fridays
by ihateolives on Thursday February 17, 2022 @02:08AM
(#30370334)
Yeah, me too. I had severe time constraints (heh) and just wanted to be done with it with minimal conversion. Which I then had to do anyway later. I also learned on that day that Javascript's getUTCMonth() is zero-based (January is month 0). And I had to sync time between timezones as well. I don't want to work with dates ever again.
Re:Perl code that is syntactically correct only on Fridays
by adhoc_slime on Wednesday February 16, 2022 @12:05PM
(#30362493)
I've learned the hard way that this is also dependent on the user's date format set on their computer in some libraries(iirc it was jquery ui date picker a few years back). its liberating when you decide to throw it all out and just use integers for all things not facing an end user.