DATE(1)

NAME
date - print or set the date

SYNOPSIS
date [-u] [+format]
date [-u] [-b] HHMM | mmddHHMM[[cc]yy]
date -a [-]sss.fff

DESCRIPTION
Date displays the current date if invoked without arguments or with a +format argument.

If the first argument does not start with +, date sets the system time to the given value, which may consist of

    mm | month of year (01–12)
    dd | day of month (01–31)
    HH | hour (00–23)
    MM | minute (00–59)
    cc | first two digits of year
    yy | second two digits of year

The following options alter the behavior of date:

-a [-]sss.fff
    Adjust the system clock by sss seconds and fff milliseconds, speeding up or, with -, slowing down.

-u  Use UTC values for printing and setting the date.

The following option is an extension:

-b  Causes date not to alter the `wtmp' file for the system time change.

An argument starting with + specifies a format string to print the current date. A percent character % introduces a field descriptor with one or two following characters which is replaced by a part of the current date, as shown in the table below. Other characters are printed literally. A newline character is printed at the end of the output.

Field descriptors:
    a | locale-specific abbreviated weekday name (System III)
    A | locale-specific full weekday name (SVID3, POSIX.2)
    b | locale-specific abbreviated month name (SVID3, POSIX.2)
    B | locale-specific full month name (SVID3, POSIX.2)
    c | locale-specific date and time (SVID3, POSIX.2)
    C | century – 19 or 20 (POSIX.2) (/usr/5bin/s42/date, /usr/5bin/posix/date, /usr/5bin/posix2001/date) default output format (/usr/5bin/date)
    d | day of month – 01 to 31 (System III)
    D | date as mm/dd/yy (System III)
    e | day of month – 1 to 31 (SVID3, POSIX.2)
    F | date as yyyy-mm-dd
    g | week-based year within century – 00 to 99
    G | week-based year including century – 0000 to 9999
    h | same as %b (System III)
    H | hour – 00 to 23 (System III)
    I | hour – 01 to 12 (SVID3, POSIX.2)
    j | day of year – 001 to 366 (System III)
    m | month of year – 01 to 12 (System III)
    M | minute – 00 to 59 (System III)
    n | newline character (System III)
    N | default output format
    p | locale-specific AM/PM string (SVID3, POSIX.2)
    r | locale-specific time using AM/PM notation (System III)
    R | same as %H:%M (SVID3)
    S | second – 00 to 61 (System III)
    t | tab character (System III)
    T | time as HH:MM:SS (System III)
    u | weekday – 1 (Monday) to 7 (POSIX.2)
    U | week of year (Sunday as first day of week) – 00 to 53 (SVID3, POSIX.2)
    V | week of year (Monday as first day of week) – 01 to 53 (POSIX.2)
    w | weekday – 0 (Sunday) to 6 (System III)
    W | week of year (Monday as first day of week) – 00 to 53 (SVID3, POSIX.2)
    x | locale-specific date (POSIX.2)
    X | locale-specific time (SVID3, POSIX.2)
    y | last two digits of year – 00 to 99 (System III)
    Y | four-digit year – 1970 to 2037 (SVID3, POSIX.2)
    z | numeric timezone
    Z | timezone name (SVID3, POSIX.2)
    % | percent sign (System III)
    Ec | alternative date and time (POSIX.2)
    EC | alternative base year (period) (POSIX.2)
    Ex | alternative date (POSIX.2)
    EX | alternative time (SUSv2)
    Ey | offset from %EC in years (POSIX.2)
    EY | full alternative year (POSIX.2)
    Od | day of month filled with leading zero using alternative numerals (POSIX.2)
    Oe | day of month filled with leading space using alternative numerals (POSIX.2)
    OH | 24-hour clok using alternative numerals (POSIX.2)
    OI | 12-hour clock using alternative numerals (POSIX.2)
    Om | month of year using alternative numerals (POSIX.2)
    OM | minute using alternative numerals (POSIX.2)
    OS | second using alternative numerals (POSIX.2)
    Ou | weekday (Monday = 1) using alternative numerals (POSIX.2)
    OU | week of year (cf. %U) using alternative numerals (POSIX.2)
    OV | week of year (cf. %V) using alternative numerals (POSIX.2)
    Ow | weekday (Sunday = 0) using alternative numerals (POSIX.2)
    OW | week of year (cf. %W) using alternative numerals (POSIX.2)
    Oy | year (offset from %C) using alternative numerals (POSIX.2)

Compatibility references:
    System III | AT&T System III manual page date(1).
    SVID3 | AT&T System V Interface Definition, Third Edition, Volume II, 1992, date(BU_CMD). Includes all field descriptors present in System III.
    POSIX.2 | ISO/IEC 9945-2:1993(E), 4.15.4.1–4.15.4.2, pp. 241–242. Includes all field descriptors present in System III.
    SUSv2 | The Open Group, Single UNIX Specification, Version 2, © 1997, date(XCU). Includes all field descriptors present in POSIX.2.

When no arguments are given, the format defaults to

    %a %b %e %H:%M:%S %Z %Y

in the C or POSIX locale, resulting in an output like

    Wed Feb 26 17:48:54 CET 2003

ENVIRONMENT VARIABLES

LANG, LC_ALL
    See locale(7).

LC_TIME
    Alters the strings printed when format arguments are given.

TZ  Timezone; if unset, the system default is used.

SEE ALSO
adjtime(2), stime(2), strftime(3), locale(7)

NOTES
After setting the date, the hwclock(8) utility is called to adjust the hardware clock on Linux systems.