Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: What is a stringwise operator?

by jhourcle (Prior)
on Feb 25, 2008 at 18:34 UTC ( [id://670079]=note: print w/replies, xml ) Need Help??


in reply to Re^3: What is a stringwise operator?
in thread What is a stringwise operator?

Order date/time from largest to smallest unit has been around a _lot_ longer than 8601 (1988) . However, the formatting being discussed will _not_ work generically for 8601 dates, as there are so many acceptable formats that it would NOT be reliable.

8601 includes formats for DOY (day of year) and week of year:

'2004-002' vs. '2004-W01-03' vs. '2004-01-01'

Straight string comparison (without stripping delimiters) would also fail on comparing the mentioned format to an 8601 datetime, as they use a 'T' between the date and time portion, and the delimiters are optional for some formats:

'2004-01-01T01:30Z' vs '20040101T0130Z'

You also can't blindly strip delimiters and assume things are in the right order, as there's options for repetition and duration:

'R3/2008-01-01P1D' vs. '2008-01-01P3D' vs. '2008-01-01/03' vs. '2008-01-01T00:00Z/03T24:00'

But, the biggest (and most encountered, in my case) problem is that until the 2004 revision of 8601, it was acceptable to use 2 digit years, which meant that 6 digits without delimiters was YYMMDD, not YYYYMM:

'200101' vs '2010-01'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-16 20:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found