Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: convert a given YYYY-MM-DD to epoch time

by jeffa (Bishop)
on Dec 04, 2015 at 22:28 UTC ( #1149418=note: print w/replies, xml ) Need Help??


in reply to convert a given YYYY-MM-DD to epoch time

Your main requirement seems to simply be to "determine what day it was," and you can do that with several CPAN modules. I really like Time::Piece

use strict; use warnings; use Time::Piece; my $date = shift || '1999-12-31'; my $time = Time::Piece->strptime( $date, '%Y-%m-%d' ); print $time, $/; print $time->fullday, $/;

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2019-05-20 01:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (123 votes). Check out past polls.

    Notices?