Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Time string with addition

by sundialsvc4 (Monsignor)
on Jan 06, 2012 at 13:59 UTC ( #946599=note: print w/ replies, xml ) Need Help??


in reply to Time string with addition

A quick CPAN search on the terms date time datetime calc (e.g...) should give you all the tools that you could possibly need, should you decide not to do the job in SQL.   (And, frankly, “I’d rather not,” because I tend to find SQL functions both non-standard and sometimes wanting.)

I don’t know if DateTime::Calendar::Mayan has been updated for 2012 yet, or not, but it’s there, nevertheless.

Any way you do it, you do it the same way:   convert whatever string you have into an opaque date/time value, manipulate the value with the tools provided, then convert it back to a string.   Use your own regular expressions, or ones cabbaged from Regexp::Common, to fill in any gaps.


Comment on Re: Time string with addition

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2014-09-19 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (143 votes), past polls