Did you read the man page?
The synopsis of the command is this:
Code:
date [OPTION]... [+FORMAT]
The formats are extensive, but these 2 do what you request:
Code:
%k hour ( 0..23)
%l hour ( 1..12)
Thats 24-hour and 12-hour, respectively. Thus:
Code:
[scuzzy@slackdell /home/scuzzy]$ date
Tue Jan 31 05:38:17 EST 2006
[scuzzy@slackdell /home/scuzzy]$ date +%k
5
[scuzzy@slackdell /home/scuzzy]$ date +%l
5
[scuzzy@slackdell /home/scuzzy]$