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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date in format 31/10/2004

Status
Not open for further replies.

hcclnoodles

IS-IT--Management
Jun 3, 2004
123
0
0
GB
Hi there

I need to pass the current date to a script the following format

31/10/2004

I presume id use the 'date' command but does anybody know how I would get this format returned so that i can slot it into a variable and pass it to my script

cheers
Gary
 
when i say 31/10/2004 i do of course mean DD/MM/YYYY

cheers
 
date +"%m/%d/%Y"

like var1=$(date +"%m/%d/%Y")
echo $var1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top