DATE

Section: User Commands (1)
Updated: July 22, 1993
Index Return to Main Contents
 

NAME

date - print and set the date  

SYNOPSIS

date [ -n ] [ -u ] [ yymmddhhmm[.ss] ]  

DESCRIPTION

If no arguments are given, the current date and time are printed. Providing an argument will set the desired date. Only the superuser can set the date.

The -u flag is used to display or set the date in GMT (universal) time. yy represents the last two digits of the year; the first mm is the month number; dd is the day number; hh is the hour number (24 hour system); the second mm is the minute number; .ss is optional and represents the seconds. For example:

date 8506131627

sets the date to June 13 1985, 4:27 PM. The year, month and day may be omitted; the default values will be the current ones. The system operates in GMT. Date takes care of the conversion to and from local standard and daylight-saving time.

If a network time system is being used to synchronize the clocks of machines on the network, the network time will eventually override the time set locally by date. The recommended network time synchronization daemon is ntpd(8). (However, if instead the old daemon timed(8) is running, date sets the time globally on all the network's machines unless the -n option is given.)  

SEE ALSO

gettimeofday(2), ntpd(8)  

DIAGNOSTICS

Exit status is 0 on success and 1 on failure to set the date. (An exit status of 2 means that timed(8) is running and the local date was set successfully, but not the global date.)

If you try to set the date but are not the super-user, an error message is printed, along with the current (unchanged) date and time.


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
DIAGNOSTICS

This document was created by man2html, using the manual pages.
Time: 13:54:10 GMT, September 25, 2024