Transfer from http://blog.chinaunix.net/uid-8223172-id-2511672.html
The use of date in Linux is more complex, but it also uses more, especially in the shell. Now summarize some of the usage that you often use.
1. Time Settings
# date-s 20080305--------> Set Date
# date-s 12:19:50-------> set time
2. Timestamp, time stamp is the number of seconds from January 1, 1970 0:0 to now.
Date +%s
Conversely: By the number of seconds to check the specific date
Date-d ' 1970-01-01 UTC 1204704624 seconds '
3. Display hours in 24-hour system
Date +%h
4. Display hours in 12-hour system
Date +%i
5. Display the month of the Year in decimal numbers (01-12)
Date +%m
6. Display minutes in decimal number (00-59)
Date +%m
7. Display the last two digits of the year (00-99)
Date +%y
8. Display the year in four digits in decimal
Date +%y
9. Display the date in YYYY-MM-DD mode
Date-i
Usage of the date command under Linux