![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| converting unix timestamp into readable format using c++ | uselessprog | High Level Programming | 3 | 04-07-2008 12:07 PM |
| Formatting of file to an desired one | pkondur | Shell Programming and Scripting | 5 | 04-01-2008 10:26 PM |
| Desired Format ! | prasanth_babu | HP-UX | 1 | 02-20-2008 07:31 AM |
| capturing the time stamp in desired format | pavan_test | UNIX for Dummies Questions & Answers | 2 | 09-21-2006 05:17 PM |
| how to convert from timestamp to date format in tcsh | umen | Shell Programming and Scripting | 2 | 11-22-2005 01:51 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
get the timestamp of a file in desired format
Hi,
I have a file say abc. I get the timestamp in following way: ls -ltr abc | awk -F" " '{print $6,$7,$8}' Mar 8 10:23 I need to get the timestamp as : 03-08-2007 10:23:00 Thanks Sumeet |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
This is one line with perl...
perl -e '@d=localtime ((stat(shift))[9]); printf "%02d-%02d-%04d %02d:%02d:%02d\n", $d[3],$d[4]+1,$d[5]+1900,$d[2],$d[1],$d[0]' file1.txt |
||||
| Google The UNIX and Linux Forums |