Ow Mun Heng wrote:
I'm wondering there's a simpler was to achieve this w/o need to jump
through a couple of hoops. (meaning, concatenate the fields together
from extract or some other method)

Timestamp : '2008-01-17 10:24:00'
Output needed : 20080103 or even 200801w3

    use POSIX;
    use Date::Parse;
    my $timestamp = '2008-01-17 10:24:00';
    print strftime "%Y%m%V\n", (strptime $timestamp)[0..5];

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

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


Reply via email to