Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: sorting dates in YYYYMMDD format

by salva (Monsignor)
on Jul 04, 2013 at 07:11 UTC ( #1042347=note: print w/ replies, xml ) Need Help??


in reply to Re: sorting dates in YYYYMMDD format
in thread sorting dates in YYYYMMDD format

One of the great things about YYYYMMDD is that if you sort it lexicographically you get it properly sorted!

@ordered = sort @dates;


Comment on Re^2: sorting dates in YYYYMMDD format
Download Code
Re^3: sorting dates in YYYYMMDD format
by QM (Vicar) on Jul 10, 2013 at 09:10 UTC
    One of the great things about YYYYMMDD is that if you sort it lexicographically you get it properly sorted!

    Yes! This is what bugs me about all the international date "standards" -- none of them sort naturally. The only tweak I use is for human readability, YYYYMMmmmDD, where mmm is the 3 letter abbreviation (in the language of choice), which helps the mildly dyslexic distinguish 5 March and 3 May (though maybe that's the hardest one).

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

      Hos does a date in ISO 8601 format -- YYYY-MM-DDThh:mm:ss (and variations) -- does not sort correctly? Or, by "international date "standards"" did you mean something else?

        "Hos does a date in ISO 8601 format -- YYYY-MM-DDThh:mm:ss (and variations) -- does not sort correctly?" -- self.

        That horrible sentence should have been: "How do dates in ... -- YYYY-MM-DDThh:mm:ss (and variations) -- not sort correctly?".

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1042347]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2014-08-28 14:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (263 votes), past polls