DATE(1)

๐Ÿ’– DATE(1) ๐Ÿ’–

okay bestie, sit down, hydrate, because we're doing the date page. This one lives in the User Commands part of the manual (section 1, you know the vibe), and it's genuinely one of the most useful little gremlins in your whole toolbox. Let's get into it ๐Ÿซถ


โœจ NAME โœจ

date โ€” print or set the system date and time. that's it. that's the whole job. and yet. ๐Ÿ‘‘


๐ŸŒธ SYNOPSIS ๐ŸŒธ

date [OPTION]... [+FORMAT]
date [OPTION]... MMDDhhmm[[CC]YY][.ss]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So like โ€” it displays the date and time in whatever FORMAT you hand it. And if you use -s, or you go the chaotic route and pass MMDDhhmm[[CC]YY][.ss], it sets the date and time first instead. two modes, one legend.

Real talk though: mandatory arguments to long options are mandatory for short options too. no shortcuts on the shortcuts, babes. ๐Ÿ’…

๐Ÿ’… OPTIONS ๐Ÿ’…

  • -d, --date=STRING โ€” display the time described by STRING, not 'now'. so you can be like "no actually, show me a different moment"
  • --debug โ€” annotates the parsed date, and warns you about questionable usage over on standard error. it's giving "bestie let me check your work" ๐Ÿ”
  • -f, --file=DATEFILE โ€” like --date, but once for each line of DATEFILE; and if DATEFILE is -, it reads names from standard input. bulk mode, we love efficiency
  • -I[FMT], --iso-8601[=FMT] โ€” output date/time in ISO 8601 format. FMT can be 'date' (that's the default), 'hours', 'minutes', 'seconds', or 'ns' for date and time to the indicated precision. Example: 2006-08-14T02:34:56-06:00
  • --resolution โ€” outputs the available resolution of timestamps. Example: 0.000000001 โœจ
  • -R, --rfc-email โ€” output date and time in RFC 5322 format. Example: Mon, 14 Aug 2006 02:34:56 +0000
  • --rfc-3339=FMT โ€” output date/time in RFC 3339 format. FMT is 'date', 'seconds', or 'ns' for date and time to the indicated precision. Example: 2006-08-14 02:34:56-06:00
  • -r, --reference=FILE โ€” display the last modification time of FILE
  • -s, --set=STRING โ€” set the time described by STRING
  • -u, --utc, --universal โ€” print or set Coordinated Universal Time (UTC). the one true timezone, sorry to your local clock
  • --help โ€” display this help and exit
  • --version โ€” output version information and exit
โš ๏ธ okay important: all options that specify the date to display are mutually exclusive. I.e.: --date, --file, --reference, --resolution. pick one. they are not a friend group, they are a "one at a time" situation. ๐Ÿšซ

๐ŸŽ€ FORMAT ๐ŸŽ€

FORMAT controls the output. here are the interpreted sequences, and honestly this list ate:

  • %% โ†’ % โ€” a literal %
  • %n โ†’ \n โ€” a newline
  • %t โ†’ \t โ€” a tab
  • %C โ†’ 20 โ€” century; like %Y, except omit last two digits
  • %y โ†’ 99 โ€” year (last two digits; 00..99)
  • %Y โ†’ 1999 โ€” year
  • %g โ†’ 99 โ€” year of ISO week number (last 2 digits; 00-99); see %G
  • %G โ†’ 1999 โ€” year of ISO week number; normally useful only with %V
  • %a โ†’ Sun โ€” locale's abbreviated weekday name
  • %A โ†’ Sunday โ€” locale's full weekday name
  • %b โ†’ Mar โ€” locale's abbreviated month name
  • %h โ†’ Mar โ€” same as %b
  • %B โ†’ March โ€” locale's full month name
  • %m โ†’ 12 โ€” month (01..12)
  • %d โ†’ 31 โ€” day of month (01..31)
  • %e โ†’ 1 โ€” day of month, space padded; same as %_d
  • %D โ†’ 12/31/99 โ€” date (ambiguous); same as %m/%d/%y
  • %F โ†’ 1999-12-31 โ€” full date; like %+4Y-%m-%d
  • %x โ†’ 12/31/99 โ€” locale's date (can be ambiguous)
  • %c โ†’ ... โ€” locale's date and time (e.g., Thu Mar 3 23:05 2005)
  • %H โ†’ 23 โ€” hour (00..23)
  • %I โ†’ 01 โ€” hour (01..12)
  • %k โ†’ 8 โ€” hour, space padded ( 0..23); same as %_H
  • %l โ†’ 9 โ€” hour, space padded ( 1..12); same as %_I
  • %M โ†’ 59 โ€” minute (00..59)
  • %S โ†’ 60 โ€” second (00..60)
  • %N โ†’ 123456789 โ€” nanoseconds (000000000..999999999)
  • %s โ†’ 1970010100 โ€” seconds since the Epoch (1970-01-01 00:00 UTC)
  • %p โ†’ PM โ€” locale's equivalent of AM or PM; blank if not known
  • %P โ†’ am โ€” like %p, but lower case
  • %r โ†’ 1:11:04 PM โ€” locale's 12-hour clock time
  • %R โ†’ 23:59 โ€” 24-hour hour and minute; same as %H:%M
  • %T โ†’ 23:59:59 โ€” time; same as %H:%M:%S
  • %X โ†’ 23:59:59 โ€” locale's time representation
  • %j โ†’ 365 โ€” day of year (001..366)
  • %q โ†’ 4 โ€” quarter of year (1..4)
  • %u โ†’ 7 โ€” day of week (1..7); 1 is Monday
  • %w โ†’ 6 โ€” day of week (0..6); 0 is Sunday
  • %U โ†’ 52 โ€” week of year; Sunday as first day of week (00..53)
  • %V โ†’ 52 โ€” ISO week number; Monday as first day of week (01..53)
  • %W โ†’ 52 โ€” week of year; Monday as first day of week (00..53)
  • %z โ†’ +0400 โ€” +hhmm numeric time zone
  • %:z โ†’ +04:00 โ€” +hh:mm numeric time zone
  • %::z โ†’ +04:00:00 โ€” +hh:mm:ss numeric time zone
  • %:::z โ†’ +04 โ€” numeric time zone to necessary precision; with :
  • %Z โ†’ EDT โ€” alphabetic time zone abbreviation

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 modifier, 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. that's the whole grammar, you got this ๐Ÿงš


๐Ÿ”ฅ 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/Los_Angeles' date

Show the local time for 9AM next Friday on the west coast of the US:

$ date --date='TZ="America/Los_Angeles" 09:00 next Fri'

๐ŸŒˆ DATE STRING ๐ŸŒˆ

The --date=STRING is a mostly free format human readable date string such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or even "next Thursday". no cap, it really does just understand that. A date string may contain items indicating calendar date, time of day, time zone, day of week, relative time, relative date, and numbers. An empty string indicates the beginning of the day. The date string format is more complex than is easily documented here but is fully described in the info documentation. (iykyk โ€” go read the info page, it's the extended cut ๐Ÿ’€)


๐Ÿซถ AUTHOR ๐Ÿซถ

Written by David MacKenzie. thank you king ๐Ÿ‘‘


๐Ÿ˜ญ REPORTING BUGS ๐Ÿ˜ญ

Report bugs to: bug-coreutils@gnu.org. Report any translation bugs to: https://translationproject.org/team/. GNU coreutils home page: https://www.gnu.org/software/coreutils/ General help using GNU software: https://www.gnu.org/gethelp/


Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (say it with me: no warranty, bestie ๐Ÿšจ)


โญ SEE ALSO โญ

Full documentation https://www.gnu.org/software/coreutils/date or available locally via: info '(coreutils) date invocation'


okay that's the whole page, you're officially a date girlie now ๐ŸŒธ stay hydrated, check your timezones, and remember: this was GNU coreutils 9.12, dated September 2026 โ€” the DATE(1) era. mwah ๐Ÿ’–๐ŸŽ€

๐Ÿ“ฆ where this page comes from