bug fuss to print the time including zone

J

jidanni

Geez, to print the time including the timezone offset, it's either
print localtime() . " +0800\n"; #Hardwire it, or
print `date -R`; #Expensive
Any other solution and were talking at least a three lines of code,
"use", etc. no?
 
J

John W. Krahn

Geez, to print the time including the timezone offset, it's either
print localtime() . " +0800\n"; #Hardwire it, or
print `date -R`; #Expensive
Any other solution and were talking at least a three lines of code,
"use", etc. no?

$ perl -le'use POSIX; print strftime "%F %T %z %Z", localtime'
2009-05-15 23:15:10 -0700 PDT


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top