Operating System - HP-UX
1833105 Members
3475 Online
110051 Solutions
New Discussion

how can i change Apr to 4 ,May to 5..

 
SOLVED
Go to solution
iambluegary
Advisor

how can i change Apr to 4 ,May to 5..

in hpux ,when i use date,it show:
Fri Apr 26 08:58:24 EAT 2002
but i need the month in number,so i can use it in my shell script to search some files.
how can i make a shell that i can use in other shelles to change it ,i dont konw how can one shell use another shell to finish one function.
help ,help,help :-)
3 REPLIES 3
Steven Sim Kok Leong
Honored Contributor
Solution

Re: how can i change Apr to 4 ,May to 5..

Hi,

This will show the current month as a numeric:

# date +%m

Following gives you year,month and date (eg. 20020426) together:

# date +%Y%m%d

Hope this helps. Regards.

Steven Sim Kok Leong
S.K. Chan
Honored Contributor

Re: how can i change Apr to 4 ,May to 5..

Date command can be displayed in so many ways including displaying month as decimel. Check
the man pages for details.
# man date
Basically one example ..
# date +%m%d
0425

iambluegary
Advisor

Re: how can i change Apr to 4 ,May to 5..



thank you so much ,you are so helpful
help ,help,help :-)