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
-
C0D4681454y@RememberMe bloody Americans 😔 even when they have standards, they go and make their own.
-
dd/mm/yyyy for human-readable dates.
yyyy/mm/dd for human-readable time-stamps.
Unix for non-human-readable timestamps. -
hjk10157314y@Ranchu don't you mean dd-mm-yyyy
I can live with that but it's still stupid.
A number 123.45 has the opposite significance. We all know that yyyy-mm-dd sorts well. But don't forget that we hate the American date because it has mixed significance; when we take dd-mm-yyyy and add time it's going to be dd-mm-yyyy hh:mm:ss. Mixed fucking significance again. Good luck sorting that. -
hjk10157314y@metamourge yyyy-mm-dd for human readable dates. It's just the one that makes the most sense and actually readsb the best especially with time added
-
@hjk101 honest opinion? Preference hereby is based upon what one was raised with.
-
hjk10157314y@Ranchu Americans do it so messed up because they say it like 26th of may 2020. I did grow up with dd-mm-yyyy but it's still technically less readable than yyyy-mm-dd.
But sure you train your mind and if you have been doing it your whole life it becomes effortless. Just look at how many people think binary or hex can never be comprehended. Yet they use a mixed base system like time. -
Store dates where time is known (and matters) as
ISO 8601 timestamps in UTC 2020-05-26T10:33:58Z no matter what the users timezone convert to UTC. Convert it back to the users locale for display. Make sure to store the users time zone somewhere (not EST but America/New_York so DST calculations can happen via your time lib). Storage of a time zone with your user (or somewhere) is important so you can convert back for things like reports and downloads where you don’t have the benefit of the user’s computers time zone.
For dates that don’t care about time. Birthdays, store YYYY-MM-DD. For display once again convert to what ever the users locale calls for on front end.
After years of API design for a national platform with customers across America this is the only way to stay sane.
Related Rants
cant we already get to a point where we have one single fat datetime format in CS...
ISO this, RFC that, UNIX those
rant
time