BladeSystem Forums have moved here
To make BladeSystem information easier to find, we have moved the BladeSystem forums here, to Servers and Operating Systems.
Showing results for 
Search instead for 
Do you mean 

Date formatiing

SOLVED
Go to Solution
Highlighted
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
Acclaimed Contributor

Re: Date formatiing

Hi:

See the manpages for 'date':

# date +%m/%d/%y

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

Regards!

...JRF...
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