in reply to Print time in Date"T"time+Gmtoffset
Is the colon required in the offset for your purposes? If not:
perl -E ' use POSIX; say strftime "%Y-%m-%dT%H:%M:%S%z", localtime(); ' 2014-03-31T23:37:59-0700
If you want the colon and no zero-padding, you could grab the offset by itself (strftime "%z", localtime();), throw a colon in it and drop the leftmost digit if it is 0. Or there might be an easier way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Print time in Date"T"time+Gmtoffset
by ikegami (Patriarch) on Apr 01, 2014 at 14:17 UTC | |
|
Re^2: Print time in Date"T"time+Gmtoffset
by techman2006 (Beadle) on Apr 01, 2014 at 07:00 UTC | |
by Anonymous Monk on Apr 01, 2014 at 07:05 UTC |