[sf-lug] Unix time conversion (human readable time into 'unix' time)

Michael Paoli Michael.Paoli at cal.berkeley.edu
Sat Nov 8 02:08:53 PST 2008


Quoting "Michael Paoli" <Michael.Paoli at cal.berkeley.edu>:

>> Date: Mon, 27 Oct 2008 15:46:04 -0700 (PDT)
>> From: Alex Kleider <a_kleider at yahoo.com>
>> Subject: Re: [sf-lug] unix time conversion
>> To: Linux userGroup <sf-lug at linuxmafia.com>
>>
>> Now that you have wetted my appetite:   How to change a human
>> readable time into 'unix time?'
>
> $ date -Iseconds
> 2008-10-29T01:11:41-0700
> $ iso2epoch 2008-10-29T01:11:41-0700
> 1225267901
> $  perl -e 'print(localtime(1225267901) . "\n");'
> Wed Oct 29 01:11:41 2008
> $
> iso2epoch is a perl utility I whipped up about two months ago
> http://www.rawbw.com/~mp/perl/#iso2epoch
> http://www.rawbw.com/~mp/perl/iso2epoch.tar.gz

Or more generally, have a look at:
http://faq.perl.org/perlfaq4.html#How_can_I_take_a_str





More information about the sf-lug mailing list