Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
makinet1998yThere are 3 ways to write dates; there's the perfectly rational and logical way, the American way, and the ISO which is the first option reversed that nobody uses anyways.
-
What about:
'#76ab%Y%Y@98:%M%D%h@()%m&%m%Y%D%Y€¥$¢%M%h+%s-%s%%'
Where:
- %Y stands for one number of the last year
- %M stands for one number of the following month
- %D stands for one number (09, two numbers) of SQRT((CURRENT_DAY^7)/3)
- %h stands for one number of the hour next evening(12h system)
- %% stands for either 7 or 3, 7 means that the hour(%h) is a.m., 3 means that the hour is p.m.
- %m stands for the minute the next solar eclipse will happen
- %s stands for one number of the second you will hate yourself to have this system implemented. -
Gophyr19138ySeconds since the Unix Epoch (1 January 1970). All other human-useful time formats can come from this.
:D -
mhudson12938yThis is why I love devrant. Can't remember the last time I saw an honest-to-god debate about time stamps. 😂
-
WDot518ySo with ISO your can sort dates perfectly, with the American system you can at least sort by month and day. With the European system you get smugness? Are there any real advantages besides "this is how Europe does it?"
-
@WDot Europe uses ISO. People usually don't, but it's the official standard in the EU, used by many governmental organizations.
I tend to either use ISO or human-readable phrases ("2 days ago") when representing dates, depending on context.
The problem with dd/mm/yyyy is that people could think you're using US format.
ISO is unambiguous, friendlier than unix timestamps, and precise. Using phrases is less precise, but the friendliest format possible and timezone independent. -
krlooss4918yyyyymmdd easy parseable and even compared as text or number. Just need to be sure to add trailing 0s to years month or days
-
smaller units on the right, it's only common sense. easy to increment and sort that way
-
Why is no one including time zone offsets? RFC3339 all the way!
2008-09-08T22:47:31-07:00
2008-09-09T05:47:31Z
Totally unambiguous, human-readable, sortable, lots of library support.
Girl: What's your idea of the perfect date?
Me: dd/mm/yyyy, others formats are confusing
Me: Wait where are you going
undefined