in reply to Convert Octet String DateAndTime to printable string
Suitable printf formats would be:@date = unpack 'n C6 a C2', $octets;
I didn't manage to coax the displayed text into sensible values though, so the pack format might be wrong.$datetime = sprintf "%04d-%02d-%02d %02d:%02d:%02d", @date; # no time +zone $datetime = sprintf "%04d-%02d-%02d %02d:%02d:%02d.%d%s%02d:%02d", @da +te; # with tz info
Can you give us the output of print join '-', unpack "C*", $octets; if it didn't work out?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Convert Octet String DateAndTime to printable string
by perlchild (Acolyte) on Apr 28, 2007 at 02:13 UTC | |
by Anonymous Monk on May 09, 2007 at 18:33 UTC | |
by uk1577 (Initiate) on Jun 03, 2008 at 18:12 UTC | |
by rhesa (Vicar) on Jun 05, 2008 at 13:05 UTC | |
by Anonymous Monk on Jun 03, 2008 at 17:52 UTC | |
by uk1577 (Initiate) on Jun 03, 2008 at 18:10 UTC | |
|
Re^2: Convert Octet String DateAndTime to printable string
by Anonymous Monk on Jun 05, 2008 at 07:04 UTC | |
|
Re^2: Convert Octet String DateAndTime to printable string
by Anonymous Monk on Jun 05, 2008 at 07:06 UTC |