DATE(1)
π date(1) β the General Commands Manual glow-up π
okay bestie, sit DOWN. we're talking about date(1) β the general commands manual's most underrated icon. she prints the system date and time, she sets the system date and time, she does format sequences like it's nothing. main character energy fr fr ππ
β¨ NAME β¨
date β print or set the system date and time π°οΈπ
π SYNOPSIS π
date [OPTION]... [+FORMAT]...
date [OPTION]... [MMDDhhmm[[CC]YY][.ss]]
FORMAT controls the output, bestie. and the interpreted sequences are β get ready, this is the whole squad:
πΈ the format sequences (she's giving RANGE) πΈ
%%β a literal%β e.g.%%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.g.12/31/99%eβ day of month, space padded; same as%_dβ e.g.3%Fβ full date; same as%Y-%m-%dβ e.g.2005-03-03%gβ last two digits of year of ISO week number (see%G) β e.g.05%Gβ year of ISO week number (see%V); normally useful only with%Vβ e.g.2005%hβ same as%bβ e.g.Jan%Hβ hour (00..23) β e.g.23%Iβ hour (01..12) β e.g.11%jβ day of year (001..366) β e.g.062%kβ hour, space padded ( 0..23); same as%_Hβ e.g.3%lβ hour, space padded ( 1..12); same as%_Iβ e.g.9%mβ month (01..12) β e.g.03%Mβ minute (00..59) β e.g.30%nβ a newline β e.g.\n%Nβ nanoseconds (000000000..999999999) β e.g.123456789%pβ locale's equivalent of either AM or PM; blank if not known β e.g.PM%Pβ like%p, but lower case β e.g.pm%qβ quarter of year (1..4) β e.g.1%rβ locale's 12-hour clock time β e.g.11:11:04 PM%Rβ 24-hour hour and minute; same as%H:%Mβ e.g.23:30%sβ seconds since 1970-01-01 00:00:00 UTC β e.g.1615432800%Sβ second (00..60) β e.g.30%tβ a tab β e.g.\t%Tβ time; same as%H:%M:%Sβ e.g.23:30:30%uβ day of week (1..7); 1 is Monday β e.g.4%Uβ week number of year, with Sunday as first day of week (00..53) β e.g.10%Vβ ISO week number, with Monday as first day of week (01..53) β e.g.12%wβ day of week (0..6); 0 is Sunday β e.g.4%Wβ week number of year, with Monday as first day of week (00..53) β e.g.11%xβ locale's date representation β e.g.03/03/2005%Xβ locale's time representation β e.g.23:30:30%yβ last two digits of year (00..99) β e.g.05%Yβ year β e.g.2005%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 padding flags (yes she has OPTIONS, we love a customizable queen) π
by default, date pads numeric fields with zeroes. but the following optional flags may follow '%':
-(hyphen) do not pad the field_(underscore) pad with spaces0(zero) pad with zeros^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:
Eto use the locale's alternate representations if available, orOto use the locale's alternate numeric symbols if available.
π¦ examples (yes these live in SYNOPSIS, don't question it) π¦
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
π DESCRIPTION π
print or set the system date and time. that's it, that's the whole vibe. ππ°οΈ
π₯ OPTIONS π₯
-d,--date <STRING>β display time described bySTRING, not'now'π-f,--file <DATEFILE>β like--date; once for each line ofDATEFILEπ-I,--iso-8601 [<FMT>]β 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
possible values:
datehoursminutessecondsns
--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 -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
possible values:
datesecondsns
--debugβ annotate the parsed date, and warn about questionable usage to stderr π-r,--reference <FILE>β display the last modification time ofFILEποΈ-s,--set <STRING>β set time described bySTRINGβ°-u,--universalβ print or set Coordinated Universal Time (UTC) π-h,--helpβ Print help π-V,--versionβ Print version π·οΈ[format]
π VERSION π
v(uutils coreutils) 0.12.0 β she's still growing, be nice π«Ά
β EXAMPLES β
display the current date using the default locale's format:
date +%c
display the current date in UTC, using the ISO 8601 format:
date [-u|--utc] +%Y-%m-%dT%H:%M:%S%Z
display the current date as a Unix timestamp (seconds since the Unix epoch):
date +%s
convert a date specified as a Unix timestamp to the default format:
date [-d|--date] @1473305798
convert a given date to the Unix timestamp format:
date [-d|--date] "2018-09-01 00:00" +%s [-u|--utc]
display the current date using the RFC-3339 format (YYYY-MM-DD hh:mm:ss TZ) and specify its precision:
date --rfc-3339 date|seconds|ns
set the current date using the format MMDDhhmmYYYY.ss (YYYY and .ss are optional):
sudo date 093023592021.59
display the current ISO week number:
date +%V
the examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. please note that, as uutils is a work in progress, some examples might fail. π it's not her fault, she's literally still under construction π
okay that's the whole page, bestie!! this was date(1) from the General Commands Manual, page dated 2026-09-25, and it lives in the uutils coreutils world β version v(uutils coreutils) 0.12.0. time to go format something gorgeous. periodt. πβ¨π¦ππ
π¦ where this page comes from
- ubuntu stonking: rust-coreutils 0.12.0-1ubuntu2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms