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!

date manipulation

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
i am manipulating the date in a unix script as follows:

if [ $Day != 1 ]
then
Month=$(($Month + 1)) && Day=1

if [ $Month = 12 ]
then
Month=1 && Year=$(($Year + 1))
fi
fi


however i want to prefix the result to a filename, however it does not include zeros
eg 20020301 (1st march 2002) would be 200231

can anyone suggest a way to include the 0's
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top