268 lines
7.9 KiB
HTML
268 lines
7.9 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of DATE</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>DATE</H1>
|
|
Section: User Commands (1)<BR>Updated: September 2019<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
date - print or set the system date and time
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>date</B>
|
|
|
|
[<I>,OPTION/</I>]... [<I>,+FORMAT/</I>]
|
|
<BR>
|
|
|
|
<B>date</B>
|
|
|
|
[<I>,-u|--utc|--universal/</I>] [<I>,MMDDhhmm/</I>[[<I>,CC/</I>]<I>,YY/</I>][<I>,.ss/</I>]]
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
<P>
|
|
|
|
Display the current time in the given FORMAT, or set the system date.
|
|
<P>
|
|
|
|
Mandatory arguments to long options are mandatory for short options too.
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-d</B>, <B>--date</B>=<I>,STRING/</I><DD>
|
|
display time described by STRING, not 'now'
|
|
<DT id="2"><B>--debug</B><DD>
|
|
annotate the parsed date,
|
|
and warn about questionable usage to stderr
|
|
<DT id="3"><B>-f</B>, <B>--file</B>=<I>,DATEFILE/</I><DD>
|
|
like <B>--date</B>; once for each line of DATEFILE
|
|
<DT id="4"><B>-I[FMT]</B>, <B>--iso-8601</B>[=<I>,FMT/</I>]<DD>
|
|
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
|
|
<DT id="5"><B>-R</B>, <B>--rfc-email</B><DD>
|
|
output date and time in RFC 5322 format.
|
|
Example: Mon, 14 Aug 2006 02:34:56 <B>-0600</B>
|
|
<DT id="6"><B>--rfc-3339</B>=<I>,FMT/</I><DD>
|
|
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
|
|
<DT id="7"><B>-r</B>, <B>--reference</B>=<I>,FILE/</I><DD>
|
|
display the last modification time of FILE
|
|
<DT id="8"><B>-s</B>, <B>--set</B>=<I>,STRING/</I><DD>
|
|
set time described by STRING
|
|
<DT id="9"><B>-u</B>, <B>--utc</B>, <B>--universal</B><DD>
|
|
print or set Coordinated Universal Time (UTC)
|
|
<DT id="10"><B>--help</B><DD>
|
|
display this help and exit
|
|
<DT id="11"><B>--version</B><DD>
|
|
output version information and exit
|
|
</DL>
|
|
<P>
|
|
|
|
FORMAT controls the output. Interpreted sequences are:
|
|
<DL COMPACT>
|
|
<DT id="12">%%<DD>
|
|
a literal %
|
|
<DT id="13">%a<DD>
|
|
locale's abbreviated weekday name (e.g., Sun)
|
|
<DT id="14">%A<DD>
|
|
locale's full weekday name (e.g., Sunday)
|
|
<DT id="15">%b<DD>
|
|
locale's abbreviated month name (e.g., Jan)
|
|
<DT id="16">%B<DD>
|
|
locale's full month name (e.g., January)
|
|
<DT id="17">%c<DD>
|
|
locale's date and time (e.g., Thu Mar 3 23:05:25 2005)
|
|
<DT id="18">%C<DD>
|
|
century; like %Y, except omit last two digits (e.g., 20)
|
|
<DT id="19">%d<DD>
|
|
day of month (e.g., 01)
|
|
<DT id="20">%D<DD>
|
|
date; same as %m/%d/%y
|
|
<DT id="21">%e<DD>
|
|
day of month, space padded; same as %_d
|
|
<DT id="22">%F<DD>
|
|
full date; same as %Y-%m-%d
|
|
<DT id="23">%g<DD>
|
|
last two digits of year of ISO week number (see %G)
|
|
<DT id="24">%G<DD>
|
|
year of ISO week number (see %V); normally useful only with %V
|
|
<DT id="25">%h<DD>
|
|
same as %b
|
|
<DT id="26">%H<DD>
|
|
hour (00..23)
|
|
<DT id="27">%I<DD>
|
|
hour (01..12)
|
|
<DT id="28">%j<DD>
|
|
day of year (001..366)
|
|
<DT id="29">%k<DD>
|
|
hour, space padded ( 0..23); same as %_H
|
|
<DT id="30">%l<DD>
|
|
hour, space padded ( 1..12); same as %_I
|
|
<DT id="31">%m<DD>
|
|
month (01..12)
|
|
<DT id="32">%M<DD>
|
|
minute (00..59)
|
|
<DT id="33">%n<DD>
|
|
a newline
|
|
<DT id="34">%N<DD>
|
|
nanoseconds (000000000..999999999)
|
|
<DT id="35">%p<DD>
|
|
locale's equivalent of either AM or PM; blank if not known
|
|
<DT id="36">%P<DD>
|
|
like %p, but lower case
|
|
<DT id="37">%q<DD>
|
|
quarter of year (1..4)
|
|
<DT id="38">%r<DD>
|
|
locale's 12-hour clock time (e.g., 11:11:04 PM)
|
|
<DT id="39">%R<DD>
|
|
24-hour hour and minute; same as %H:%M
|
|
<DT id="40">%s<DD>
|
|
seconds since 1970-01-01 00:00:00 UTC
|
|
<DT id="41">%S<DD>
|
|
second (00..60)
|
|
<DT id="42">%t<DD>
|
|
a tab
|
|
<DT id="43">%T<DD>
|
|
time; same as %H:%M:%S
|
|
<DT id="44">%u<DD>
|
|
day of week (1..7); 1 is Monday
|
|
<DT id="45">%U<DD>
|
|
week number of year, with Sunday as first day of week (00..53)
|
|
<DT id="46">%V<DD>
|
|
ISO week number, with Monday as first day of week (01..53)
|
|
<DT id="47">%w<DD>
|
|
day of week (0..6); 0 is Sunday
|
|
<DT id="48">%W<DD>
|
|
week number of year, with Monday as first day of week (00..53)
|
|
<DT id="49">%x<DD>
|
|
locale's date representation (e.g., 12/31/99)
|
|
<DT id="50">%X<DD>
|
|
locale's time representation (e.g., 23:13:48)
|
|
<DT id="51">%y<DD>
|
|
last two digits of year (00..99)
|
|
<DT id="52">%Y<DD>
|
|
year
|
|
<DT id="53">%z<DD>
|
|
+hhmm numeric time zone (e.g., <B>-0400</B>)
|
|
<DT id="54">%:z<DD>
|
|
+hh:mm numeric time zone (e.g., <B>-04</B>:00)
|
|
<DT id="55">%::z<DD>
|
|
+hh:mm:ss numeric time zone (e.g., <B>-04</B>:00:00)
|
|
<DT id="56">%:::z<DD>
|
|
numeric time zone with : to necessary precision (e.g., <B>-04</B>, +05:30)
|
|
<DT id="57">%Z<DD>
|
|
alphabetic time zone abbreviation (e.g., EDT)
|
|
</DL>
|
|
<P>
|
|
|
|
By default, date pads numeric fields with zeroes.
|
|
The following optional flags may follow '%':
|
|
<DL COMPACT>
|
|
<DT id="58">-<DD>
|
|
(hyphen) do not pad the field
|
|
<DT id="59">_<DD>
|
|
(underscore) pad with spaces
|
|
<DT id="60">0<DD>
|
|
(zero) pad with zeros
|
|
<DT id="61">^<DD>
|
|
use upper case if possible
|
|
<DT id="62">#<DD>
|
|
use opposite case if possible
|
|
</DL>
|
|
<P>
|
|
|
|
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.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
Convert seconds since the epoch (1970-01-01 UTC) to a date
|
|
<DL COMPACT>
|
|
<DT id="63"><DD>
|
|
<TT>$ date --date='@2147483647'</TT>
|
|
</DL>
|
|
<P>
|
|
|
|
Show the time on the west coast of the US (use <A HREF="/cgi-bin/man/man2html?1+tzselect">tzselect</A>(1) to find TZ)
|
|
<DL COMPACT>
|
|
<DT id="64"><DD>
|
|
<TT>$ TZ='America/Los_Angeles' date</TT>
|
|
</DL>
|
|
<P>
|
|
|
|
Show the local time for 9AM next Friday on the west coast of the US
|
|
<DL COMPACT>
|
|
<DT id="65"><DD>
|
|
<TT>$ date --date='TZ="America/Los_Angeles" 09:00 next Fri'</TT>
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>DATE STRING</H2>
|
|
|
|
|
|
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". 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.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
Written by David MacKenzie.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>REPORTING BUGS</H2>
|
|
|
|
GNU coreutils online help: <<A HREF="https://www.gnu.org/software/coreutils/">https://www.gnu.org/software/coreutils/</A>>
|
|
<BR>
|
|
|
|
Report date translation bugs to <<A HREF="https://translationproject.org/team/">https://translationproject.org/team/</A>>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
Copyright © 2018 Free Software Foundation, Inc.
|
|
License GPLv3+: GNU GPL version 3 or later <<A HREF="https://gnu.org/licenses/gpl.html">https://gnu.org/licenses/gpl.html</A>>.
|
|
<BR>
|
|
|
|
This is free software: you are free to change and redistribute it.
|
|
There is NO WARRANTY, to the extent permitted by law.
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
Full documentation at: <<A HREF="https://www.gnu.org/software/coreutils/date">https://www.gnu.org/software/coreutils/date</A>>
|
|
<BR>
|
|
|
|
or available locally via: info '(coreutils) date invocation'
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="66"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="67"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="68"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="69"><A HREF="#lbAE">EXAMPLES</A><DD>
|
|
<DT id="70"><A HREF="#lbAF">DATE STRING</A><DD>
|
|
<DT id="71"><A HREF="#lbAG">AUTHOR</A><DD>
|
|
<DT id="72"><A HREF="#lbAH">REPORTING BUGS</A><DD>
|
|
<DT id="73"><A HREF="#lbAI">COPYRIGHT</A><DD>
|
|
<DT id="74"><A HREF="#lbAJ">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:09 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|