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!

Help with ctime 1

Status
Not open for further replies.

Kipnep70

Technical User
Nov 18, 2003
81
US
I'm trying to figure out how to write a script that will convert the date and time to and from the ctime format. I've seen some examples of this done in perl, but is there a way to write a script using ksh, csh, or sh? I'm on an HP-UX 11i. Thanks,

 
Hi

If you have GNU [tt]date[/tt] :
Code:
[blue]master #[/blue] date -d "Tue Jan  9 17:09:47 2007" +"%F %T"
2007-01-09 17:09:47

[blue]master #[/blue] date -d "2007-01-09 17:09:47" +%c
Tue Jan  9 17:09:47 2007

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top