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

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

by jeffa (Bishop)
on Dec 04, 2015 at 22:28 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1149418]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-03-28 14:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found