February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Prints or sets the system date and time.
Syntax
date [-u] [+field_descriptor ...]
Options
-u uses a different time zone (Greenwich Mean Time).
Oddities
Can be used by the root user to set the system date and time.
Many field descriptors are available, several of which are listed here:
%a— Locale's abbreviated weekday name (Sun–Sat)
%A— Locale's full weekday name, variable length (Sunday–Saturday)
%b— Locale's abbreviated month name (Jan–Dec)
%B— Locale's full month name, variable length (January–December)
%c— Locale's date and time format (Sat Nov 04 12:02:33 EST 1989)
%d— Day of month (01–31)
%j— Day of year (001–366)
Example
$ date Sun Nov 26 15:38:32 EST 2000 $ $ print "$(date) is day number $(date +%j) of the year." ...
Read now
Unlock full access