The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM



Thread: time convert
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #8 (permalink)  
Old 05-20-2008
ripat ripat is offline
Registered User
 

Join Date: Oct 2006
Location: Belgium
Posts: 171
Quote:
Originally Posted by b_manu78 View Post
If i give perl -le 'print scalar localtime(1211381313);' , then the output is correct...Wed May 21 11:18:33 2008.
Are you sure that it's the correct date? When I convert it my way, it give me:

GNU Awk 3.1.5
$ TZ=UTC awk 'BEGIN {print strftime("%Y-%m-%d %T", 1211381313)}'
> 2008-05-21 14:48:33

date (GNU coreutils) 5.97
$ date --utc --date "1970-01-01 1211381313 sec" "+%Y-%m-%d %T"
> 2008-05-21 14:48:33
Reply With Quote