Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Date and time difference

by sundialsvc4 (Abbot)
on Nov 17, 2010 at 15:44 UTC ( #872010=note: print w/ replies, xml ) Need Help??


in reply to Date and time difference

It is usually also a very good idea to write your code so that it actually checks the data, to be certain that the specified date/time actually exists.   I have probably encountered “GIGO” (and “pseky, esaily-overlookd litle tpyos”) more often in the context of date-strings than anything else.

To that end, using the DATE modules previously mentioned is likely to be a smart thing to do, because these modules are coded defensively.   Use a regular expression to pick-apart the date string, then actually check that (say...) the rightmost of these terms was actually extracted, then stuff the list of scalars into the DATE module of your choice.


Comment on Re: Date and time difference

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-12-27 04:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls