Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coverting TimeStamp to '%Y%m%d %H%M' 1

Status
Not open for further replies.

frangac

Technical User
Feb 8, 2004
163
ZA
Hi All,

Is there a way to covert a unix timestamp to '%Y%m%d %H%M'
for eg 1080145459 must result to "20040324182419" or "2004/03/24/18:24:19"

I have tried the following and works well, but cannot get the date format that I require.

echo "od1080145459=Y|adb | tr -d '\011' and the result is
2004 Mar 24 18:24:19

Many Thanks
Chris
 
man date

If you pipe the number to date, I think it will use that date.
 
Well, the format is not exact, but you can use "perl -we print scalar localtime 1080145459
 
The solution is here: thread271-807913

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top