1745786 Members
3409 Online
108722 Solutions
New Discussion юеВ

Date formatiing

 
SOLVED
Go to solution
Ali Imran Abbas
Regular Advisor

Date formatiing

I want to print date in the formate mm/dd/yy. Is that possible with hpux. Actually I get a file every day on my server and the next day, this file is overwritten by the new file with the same name. I wanna keep the old files. I wanna rename each file by appending the date suffix to it. Can any body help me in that. please
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: Date formatiing

Hi:

See the manpages for 'date':

# date +%m/%d/%y

# mv myfile myfile.$(date +%m%d%y)

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Date formatiing

>I want to print date in the formate mm/dd/yy.

(These are not the droids you are looking for. :-)
If you want this to sort right, you should use yy/mm/dd.
Or yyyy/mm/dd: date +%Y/%m/%d