DATE(1)

๐Ÿ“ฆ
version 9.10 ยท 5 versions
, in ubuntu stonking

๐Ÿ’– date(1) โ€” she's from the User Commands chapter and she is, frankly, iconic ๐Ÿ’–

okay so bestie, welcome to date(1). Yes, the manual name is literally User Commands, yes it's giving "boring reference page", but trust โ€” this one runs the entire clock of your whole machine. Let's get into it. ๐Ÿ•ฐ๏ธโœจ


๐ŸŽ€ NAME ๐ŸŽ€

date โ€” print or set the system date and time. That's it. That's the whole job description. Slay. ๐Ÿ’…

๐ŸŒธ SYNOPSIS ๐ŸŒธ

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

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So here's the tea: date displays the date and time in whatever FORMAT you hand it. And if you pass -s, or you do the whole MMDDhhmm[[CC]YY][.ss] thing, it sets the date and time first, then shows you. main character behaviour, honestly. ๐Ÿ‘‘

lowkey important: mandatory arguments to long options are mandatory for short options too. no exceptions, no cap. ๐Ÿ˜ค
  • -d, --date=STRING โ€” show the time that STRING describes, not 'now'. it's giving "time traveler" ๐Ÿฆ‹
  • --debug โ€” annotate the parsed date, and warn about questionable usage to standard error. it's the friend who narrates your life and also side-eyes your choices. ๐Ÿ™ˆ
  • -f, --file=DATEFILE โ€” exactly like --date, except once for each line of DATEFILE. and if DATEFILE is -, read names from standard input. ๐Ÿ“
  • -I[FMT], --iso-8601[=FMT] โ€” output date/time in ISO 8601 format. FMT='date' (default), 'hours', 'minutes', 'seconds', or 'ns' for date and time to the indicated precision. Example: 2006-08-14T02:34:56-06:00 โœจ
  • --resolution โ€” output 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='date', 'seconds', or 'ns' for date and time to the indicated precision. Example: 2006-08-14 02:34:56-06:00 ๐ŸŒˆ
  • -r, --reference=FILE โ€” show the last modification time of FILE. detective mode activated ๐Ÿ”
  • -s, --set=STRING โ€” set the time described by STRING. you're literally rewriting time rn โณ
  • -u, --utc, --universal โ€” print or set Coordinated Universal Time (UTC). the planet-wide group chat ๐ŸŒ
  • --help โ€” display this help and exit
  • --version โ€” output version information and exit
โš ๏ธ bestie watch out: all options that specify the date to display are mutually exclusive. I.e.: --date, --file, --reference, --resolution. pick ONE. you cannot have all four. choose your fighter. ๐Ÿ’€

๐Ÿ”ฎ FORMAT โ€” the part where the magic happens ๐Ÿ”ฎ

FORMAT controls the output. Here are all the interpreted sequences, no skips, no cuts:

  • %% โ€” 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 (ambiguous); 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 (ambiguous; 00-99); see %G
  • %G โ€” year of ISO week number; 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 (can be ambiguous; e.g., 12/31/99)
  • %X โ€” locale's time representation (e.g., 23:13:48)
  • %y โ€” last two digits of year (ambiguous; 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)

โœจ the little flags that follow % โœจ

by default, date pads numeric fields with zeroes. and these optional flags may follow %, bestie:

  • - โ€” (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

then, after any flags, comes an optional field width, as a decimal number; and 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. ๐Ÿงš la carte du jour, but for time.

๐ŸŒŸ 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 โ€” like "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or even "next Thursday". it literally understands "next Thursday". she's fluent. ๐Ÿ—ฃ๏ธ๐Ÿ’…

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. ๐ŸŒ…

ngl, the date string format is more complex than is easily documented here, but it is fully described in the info documentation. go read it, iykyk. ๐Ÿ“–

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Written by David MacKenzie. legend behaviour, honestly. ๐Ÿซถ

๐Ÿ˜ญ REPORTING BUGS ๐Ÿ˜ญ

like pls tell them, they wanna know, they're so normal about it ๐Ÿ’–

๐ŸŽ€ SEE ALSO ๐ŸŽ€

  • Full documentation: https://www.gnu.org/software/coreutils/date
  • or available locally via: info '(coreutils) date invocation'
  • Packaged by Ubuntu (9.10-1ubuntu2)
  • 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. ๐Ÿ˜ญ

okay that's the whole page, you made it, I'm so proud of you ๐Ÿ†๐ŸŒธ

this was GNU coreutils 9.10, from August 2026 โ€” shoutout to date(1) for never once being late. she's never beating the punctual allegations. โฐ๐Ÿ’œโœจ

๐Ÿ“ฆ where this page comes from