date(1) date(1)NAME date - displays and sets the date SYNOPSIS date [mmddhhmm[yy]] [+format] ARGUMENTS +format Puts the output of date under the control of the user. Replace format with the date and time as described in the argument below. mmddhhmm[yy] Specifies the date and time. Replace the first mm with the month number, replace dd with the day number in the month, replace hh with the hour number (24-hour system), replace the second mm with the minute number, and replace yy with the last 2 digits of the year number (this is optional). If a number less than 70 is given, the year that results is 1970. For example, date 10080045 sets the date to Oct. 8, 12:45 AM. The current year is the default if no year is mentioned. DESCRIPTION date displays the current date and time if no argument is given, or if the argument begins with +. Otherwise, the current date is set. The operating system operates in GMT. The date command takes care of the conversion to and from local standard and daylight time. All output fields are of fixed size (zero padded if necessary). Each field descriptor is preceded by % and will be replaced in the output by its corresponding value. A single % is encoded by %%. All other characters are copied to the output without change. The string is always terminated with a newline character. The Field Descriptors follow: n Inserts a newline character t Inserts a tab character m Month of year-01 to 12 d Day of month-01 to 31 y Last 2 digits of year-70 to 99 January 1992 1
date(1) date(1)D Date as mm/dd/yy H Hour-00 to 23 M Minute-00 to 59 S Second-00 to 59 T Time as HH:MM:SS j Day of year-001 to 366 w Day of week-Sunday = 0 a Abbreviated weekday-Sun to Sat h Abbreviated month-Jan to Dec r Time in AM/PM notation EXAMPLES The command: date '+DATE: %m/%d/%y%nTIME: %H:%M:%S' generates the output: DATE: 08/01/76 TIME: 14:45:05 WARNINGS It is bad practice to change the date while the system is running multiuser. STATUS MESSAGES AND VALUES No permission You are not the superuser and you tried to change the date. bad conversion The date that was set is syntactically incorrect. bad format character The field descriptor is not recognizable. FILES /bin/date Executable file /etc/wtmp File that records time 2 January 1992
date(1) date(1)SEE ALSO gettimeofday(2), stime(2), time(2), printf(3S), utmp(4) in A/UX Programmer's Reference January 1992 3