date PDF Print E-mail

date

This 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