{
    "mode": "man",
    "parameter": "date",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/man/date/json",
    "generated": "2026-09-07T03:23:46Z",
    "synopsis": "date [OPTION]... [+FORMAT]\ndate [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]",
    "sections": {
        "NAME": {
            "content": "date - print or set the system date and time\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "date [OPTION]... [+FORMAT]\ndate [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Display date and time in the given FORMAT.  With -s, or with [MMDDhhmm[[CC]YY][.ss]], set the\ndate and time.\n\nMandatory arguments to long options are mandatory for short options too.\n",
            "subsections": [
                {
                    "name": "-d --date",
                    "content": "display time described by STRING, not 'now'\n",
                    "flag": "-d",
                    "long": "--date"
                },
                {
                    "name": "--debug",
                    "content": "annotate the parsed date, and warn about questionable usage to stderr\n",
                    "long": "--debug"
                },
                {
                    "name": "-f --file",
                    "content": "like --date; once for each line of DATEFILE\n",
                    "flag": "-f",
                    "long": "--file"
                },
                {
                    "name": "-I[FMT] --iso-8601",
                    "content": "output date/time in ISO 8601 format.  FMT='date' for date only (the default), 'hours',\n'minutes',  'seconds', or 'ns' for date and time to the indicated precision.  Example:\n2006-08-14T02:34:56-06:00\n",
                    "long": "--iso-8601"
                },
                {
                    "name": "--resolution",
                    "content": "output the available resolution of timestamps Example: 0.000000001\n",
                    "long": "--resolution"
                },
                {
                    "name": "-R --rfc-email",
                    "content": "output date and time in RFC 5322 format.  Example: Mon, 14 Aug 2006 02:34:56 -0600\n\n--rfc-3339=FMT\noutput date/time in RFC 3339 format.  FMT='date', 'seconds', or 'ns' for date and time\nto the indicated precision.  Example: 2006-08-14 02:34:56-06:00\n",
                    "flag": "-R",
                    "long": "--rfc-email"
                },
                {
                    "name": "-r --reference",
                    "content": "display the last modification time of FILE\n",
                    "flag": "-r",
                    "long": "--reference"
                },
                {
                    "name": "-s --set",
                    "content": "set time described by STRING\n",
                    "flag": "-s",
                    "long": "--set"
                },
                {
                    "name": "-u --utc --universal",
                    "content": "print or set Coordinated Universal Time (UTC)\n\n--help display this help and exit\n",
                    "flag": "-u",
                    "long": "--universal"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n\nAll options that specify the date to display are mutually exclusive.  I.e.:  --date,  --file,\n--reference, --resolution.\n\nFORMAT controls the output.  Interpreted sequences are:\n\n%%     a literal %\n\n%a     locale's abbreviated weekday name (e.g., Sun)\n\n%A     locale's full weekday name (e.g., Sunday)\n\n%b     locale's abbreviated month name (e.g., Jan)\n\n%B     locale's full month name (e.g., January)\n\n%c     locale's date and time (e.g., Thu Mar  3 23:05:25 2005)\n\n%C     century; like %Y, except omit last two digits (e.g., 20)\n\n%d     day of month (e.g., 01)\n\n%D     date; same as %m/%d/%y\n\n%e     day of month, space padded; same as %d\n\n%F     full date; like %+4Y-%m-%d\n\n%g     last two digits of year of ISO week number (see %G)\n\n%G     year of ISO week number (see %V); normally useful only with %V\n\n%h     same as %b\n\n%H     hour (00..23)\n\n%I     hour (01..12)\n\n%j     day of year (001..366)\n\n%k     hour, space padded ( 0..23); same as %H\n\n%l     hour, space padded ( 1..12); same as %I\n\n%m     month (01..12)\n\n%M     minute (00..59)\n\n%n     a newline\n\n%N     nanoseconds (000000000..999999999)\n\n%p     locale's equivalent of either AM or PM; blank if not known\n\n%P     like %p, but lower case\n\n%q     quarter of year (1..4)\n\n%r     locale's 12-hour clock time (e.g., 11:11:04 PM)\n\n%R     24-hour hour and minute; same as %H:%M\n\n%s     seconds since the Epoch (1970-01-01 00:00 UTC)\n\n%S     second (00..60)\n\n%t     a tab\n\n%T     time; same as %H:%M:%S\n\n%u     day of week (1..7); 1 is Monday\n\n%U     week number of year, with Sunday as first day of week (00..53)\n\n%V     ISO week number, with Monday as first day of week (01..53)\n\n%w     day of week (0..6); 0 is Sunday\n\n%W     week number of year, with Monday as first day of week (00..53)\n\n%x     locale's date representation (e.g., 12/31/99)\n\n%X     locale's time representation (e.g., 23:13:48)\n\n%y     last two digits of year (00..99)\n\n%Y     year\n\n%z     +hhmm numeric time zone (e.g., -0400)\n\n%:z    +hh:mm numeric time zone (e.g., -04:00)\n\n%::z   +hh:mm:ss numeric time zone (e.g., -04:00:00)\n\n%:::z  numeric time zone with : to necessary precision (e.g., -04, +05:30)\n\n%Z     alphabetic time zone abbreviation (e.g., EDT)\n\nBy  default,  date  pads numeric fields with zeroes.  The following optional flags may follow\n'%':\n\n-      (hyphen) do not pad the field\n\n(underscore) pad with spaces\n\n0      (zero) pad with zeros\n\n+      pad with zeros, and put '+' before future years with >4 digits\n\n^      use upper case if possible\n\n#      use opposite case if possible\n\nAfter any flags comes an optional field width, as a decimal number; then  an  optional  modi‐\nfier,  which  is either E to use the locale's alternate representations if available, or O to\nuse the locale's alternate numeric symbols if available.\n",
                    "long": "--version"
                }
            ]
        },
        "EXAMPLES": {
            "content": "Convert seconds since the Epoch (1970-01-01 UTC) to a date\n\n$ date --date='@2147483647'\n\nShow the time on the west coast of the US (use tzselect(1) to find TZ)\n\n$ TZ='America/LosAngeles' date\n\nShow the local time for 9AM next Friday on the west coast of the US\n\n$ date --date='TZ=\"America/LosAngeles\" 09:00 next Fri'\n",
            "subsections": []
        },
        "DATE STRING": {
            "content": "The --date=STRING is a mostly free format human readable date string such  as  \"Sun,  29  Feb\n2004  16:21:42  -0800\"  or  \"2004-02-29 16:21:42\" or even \"next Thursday\".  A date string may\ncontain items indicating calendar date, time of day, time zone, day of week,  relative  time,\nrelative  date,  and  numbers.  An empty string indicates the beginning of the day.  The date\nstring format is more complex than is easily documented here but is fully  described  in  the\ninfo documentation.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Written by David MacKenzie.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright  ©  2023 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later\n<https://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.  There is NO WARRANTY,  to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Full documentation <https://www.gnu.org/software/coreutils/date>\nor available locally via: info '(coreutils) date invocation'\n\nGNU coreutils 9.4                           January 2026                                     DATE(1)",
            "subsections": []
        }
    },
    "summary": "date - print or set the system date and time",
    "flags": [
        {
            "flag": "-d",
            "long": "--date",
            "arg": null,
            "description": "display time described by STRING, not 'now'"
        },
        {
            "flag": "",
            "long": "--debug",
            "arg": null,
            "description": "annotate the parsed date, and warn about questionable usage to stderr"
        },
        {
            "flag": "-f",
            "long": "--file",
            "arg": null,
            "description": "like --date; once for each line of DATEFILE"
        },
        {
            "flag": "",
            "long": "--iso-8601",
            "arg": null,
            "description": "output date/time in ISO 8601 format. FMT='date' for date only (the default), 'hours', 'minutes', 'seconds', or 'ns' for date and time to the indicated precision. Example: 2006-08-14T02:34:56-06:00"
        },
        {
            "flag": "",
            "long": "--resolution",
            "arg": null,
            "description": "output the available resolution of timestamps Example: 0.000000001"
        },
        {
            "flag": "-R",
            "long": "--rfc-email",
            "arg": null,
            "description": "output date and time in RFC 5322 format. Example: Mon, 14 Aug 2006 02:34:56 -0600 --rfc-3339=FMT output date/time in RFC 3339 format. FMT='date', 'seconds', or 'ns' for date and time to the indicated precision. Example: 2006-08-14 02:34:56-06:00"
        },
        {
            "flag": "-r",
            "long": "--reference",
            "arg": null,
            "description": "display the last modification time of FILE"
        },
        {
            "flag": "-s",
            "long": "--set",
            "arg": null,
            "description": "set time described by STRING"
        },
        {
            "flag": "-u",
            "long": "--universal",
            "arg": null,
            "description": "print or set Coordinated Universal Time (UTC) --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit All options that specify the date to display are mutually exclusive. I.e.: --date, --file, --reference, --resolution. FORMAT controls the output. Interpreted sequences are: %% a literal % %a locale's abbreviated weekday name (e.g., Sun) %A locale's full weekday name (e.g., Sunday) %b locale's abbreviated month name (e.g., Jan) %B locale's full month name (e.g., January) %c locale's date and time (e.g., Thu Mar 3 23:05:25 2005) %C century; like %Y, except omit last two digits (e.g., 20) %d day of month (e.g., 01) %D date; same as %m/%d/%y %e day of month, space padded; same as %d %F full date; like %+4Y-%m-%d %g last two digits of year of ISO week number (see %G) %G year of ISO week number (see %V); normally useful only with %V %h same as %b %H hour (00..23) %I hour (01..12) %j day of year (001..366) %k hour, space padded ( 0..23); same as %H %l hour, space padded ( 1..12); same as %I %m month (01..12) %M minute (00..59) %n a newline %N nanoseconds (000000000..999999999) %p locale's equivalent of either AM or PM; blank if not known %P like %p, but lower case %q quarter of year (1..4) %r locale's 12-hour clock time (e.g., 11:11:04 PM) %R 24-hour hour and minute; same as %H:%M %s seconds since the Epoch (1970-01-01 00:00 UTC) %S second (00..60) %t a tab %T time; same as %H:%M:%S %u day of week (1..7); 1 is Monday %U week number of year, with Sunday as first day of week (00..53) %V ISO week number, with Monday as first day of week (01..53) %w day of week (0..6); 0 is Sunday %W week number of year, with Monday as first day of week (00..53) %x locale's date representation (e.g., 12/31/99) %X locale's time representation (e.g., 23:13:48) %y last two digits of year (00..99) %Y year %z +hhmm numeric time zone (e.g., -0400) %:z +hh:mm numeric time zone (e.g., -04:00) %::z +hh:mm:ss numeric time zone (e.g., -04:00:00) %:::z numeric time zone with : to necessary precision (e.g., -04, +05:30) %Z alphabetic time zone abbreviation (e.g., EDT) By default, date pads numeric fields with zeroes. The following optional flags may follow '%': - (hyphen) do not pad the field (underscore) pad with spaces 0 (zero) pad with zeros + pad with zeros, and put '+' before future years with >4 digits ^ use upper case if possible # use opposite case if possible After any flags comes an optional field width, as a decimal number; then an optional modi‐ fier, which is either E to use the locale's alternate representations if available, or O to use the locale's alternate numeric symbols if available."
        }
    ],
    "examples": [
        "Convert seconds since the Epoch (1970-01-01 UTC) to a date",
        "$ date --date='@2147483647'",
        "Show the time on the west coast of the US (use tzselect(1) to find TZ)",
        "$ TZ='America/LosAngeles' date",
        "Show the local time for 9AM next Friday on the west coast of the US",
        "$ date --date='TZ=\"America/LosAngeles\" 09:00 next Fri'"
    ],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Set or display the system date.",
        "examples": [
            {
                "description": "Display the current date using the default locale's format",
                "command": "date +%c"
            },
            {
                "description": "Display the current date in UTC, using the ISO 8601 format",
                "command": "date {{-u|--utc}} +%Y-%m-%dT%H:%M:%S%Z"
            },
            {
                "description": "Display the current date as a Unix timestamp (seconds since the Unix epoch)",
                "command": "date +%s"
            },
            {
                "description": "Convert a date specified as a Unix timestamp to the default format",
                "command": "date {{-d|--date}} @{{1473305798}}"
            },
            {
                "description": "Convert a given date to the Unix timestamp format",
                "command": "date {{-d|--date}} \"{{2018-09-01 00:00}}\" +%s {{-u|--utc}}"
            },
            {
                "description": "Display the current date using the RFC-3339 format (`YYYY-MM-DD hh:mm:ss TZ`) and specify its precision",
                "command": "date --rfc-3339 {{date|seconds|ns}}"
            },
            {
                "description": "Set the current date using the format `MMDDhhmmYYYY.ss` (`YYYY` and `.ss` are optional)",
                "command": "sudo date {{093023592021.59}}"
            },
            {
                "description": "Display the current ISO week number",
                "command": "date +%V"
            }
        ]
    }
}