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!

Getting Day of Month 2

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Hey all,

On Solaris 8 I have been getting the day of the month using the below:
Code:
DAY=`date | cut -d  ' ' -f3`

This works with days with two digits but does not seem to work with days with only one digit (like today 11/1/05).

What can you recommend?

Thanks,

Michael42
 
Either :
DAY=`date +%d`
Or:
DAY=`date +%e`

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Perfect! :)

I really prefer the way you guys were deriving the date, i.e. using the date command option rather than using cut.

Thanks,

Michael42
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top