I just spent 30 minutes finding this information so I thought I would post it. If you need the date and time in a shell script with YYYYMMDD format and HHMM format here is the script commands:
Output:Code:TIME=$(date +%k%M) DAY=`/bin/date +%Y%m%d`
Code:1305 20080818
The man-page of date has all the specifiers listed.
It does, so you can use the man page and change the above script as you need.
There are currently 5 users browsing this thread. (0 members and 5 guests)
Bookmarks