In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Bob Showalter) writes:
>Vladimir Lemberg wrote:
>> ...
>> Seq:1 Sat Nov 13 21:57:34 PST 2004
>> Seq:2 Sat Nov 13 22:05:17 PST 2004
>> Seq:3 Sun Nov 14 03:42:01 PST 2004
>> Seq:4 Sun Nov 14 21:57:34 PST 2004
>> 
>> I need to subtract dates to know how long each Seg took time. Is
>> there any way to convert dates back to timestamps? 
>
>Those look like ctime(3) format dates.
>
>HTTP::Date will parse those and convert back to epoch seconds

Date::Parse would be a more natural choice.

% perl -MDate::Parse -le 'print str2time("Sat Nov 13 22:05:17 PST 2004") \
                              - str2time("Sat Nov 13 21:57:34 PST 2004")'
463

And Date::Parse understands just about every date format there is, so
you don't have to look closely at what you've got to begin with.

-- 
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to