[Next] [Previous] [Up] [Top] [Contents]

4.1 System Resources

4.1.10 date - current date and time

date displays the current data and time. A superuser can set the date and time.


date [options] [+format]

Common Options

-u use Universal Time (or Greenwich Mean Time)

+format specify the output format

%a weekday abbreviation, Sun to Sat

%h month abbreviation, Jan to Dec

%j day of year, 001 to 366

%n <new-line>

%t <TAB>

%y last 2 digits of year, 00 to 99

%D MM/DD/YY date

%H hour, 00 to 23

%M minute, 00 to 59

%S second, 00 to 59

%T HH:MM:SS time


beauty condron>date

Mon Jun 10 09:01:05 EDT 1996

beauty condron>date -u

Mon Jun 10 13:01:33 GMT 1996

beauty condron>date +%a%t%D

Mon 06/10/96

beauty condron>date '+%y:%j'


Introduction to Unix - 14 AUG 1996
[Next] [Previous] [Up] [Top] [Contents]