date |
dateThis command will display the current date and time. Example: date Sun Nov 11 12:35:52 MST 2001
date has a lot of variables that you may change using this format: date +%A Sunday
The date command with the + and %A prints the full spelling of the day. Here are more formats: %a abbreviates the day %A spells out the day %b abbreviates the month %B spells out the month %d returns the day in two digits %D returns the date in mm/dd/yy format %e returns the day as a numeral 1-31 %h abbreviates the month %H returns time in a military hour %m returns the month in two numerals %M returns the number of minutes %S returns the number of seconds 0-59 %T returns time in hh:mm:ss format %Z returns a time zone name
If you have the rights to change the time this option -s will allow you to set the time. If you were root and wanted to change the date and time to August 8, 2005 at 8:46 AM you could use the following command.
date 0708084605 Fri Jul 8 08:46:00 MDT 2005
07 - august 08 - day 0846 - 8:46 AM 05 - 05
|