Reading a ctime formatted date

I

ivan

Hi,

Given a date string of this format:

Fri Apr 13 23:46:01 2007

Whats the simplest perl script that can convert the string into an epoch
number?

Thanks,
 
J

J. Gleixner

Hi,

Given a date string of this format:

Fri Apr 13 23:46:01 2007

Whats the simplest perl script that can convert the string into an epoch
number?

Probably one that uses Date::Manip, or one that splits the date and uses
Time::Local.
 
P

Peter Scott

Given a date string of this format:

Fri Apr 13 23:46:01 2007

Whats the simplest perl script that can convert the string into an epoch
number?

$ perl -MDate::parse -le 'print str2time "Fri Apr 13 23:46:01 2007"'
1176533161
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top