124 lines
2.8 KiB
HTML
124 lines
2.8 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>date(1)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>date(1)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
date - print or set the date and time
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>date</STRONG> <STRONG>[-qsu</STRONG>] [[<EM>MMDDYY</EM>]<EM>hhmm</EM>[<EM>ss</EM>]] [+<EM>format</EM>]
|
|
|
|
|
|
</PRE>
|
|
<H2>OPTIONS</H2><PRE>
|
|
|
|
<STRONG>-q</STRONG> Read the date from <EM>stdin</EM>
|
|
|
|
<STRONG>-s</STRONG> Set the time (implicit for <STRONG>-q</STRONG> or a date string)
|
|
|
|
<STRONG>-u</STRONG> Print the date as GMT
|
|
|
|
<STRONG>-t</STRONG> Use this number of seconds instead of current time
|
|
|
|
|
|
</PRE>
|
|
<H2>EXAMPLES</H2><PRE>
|
|
|
|
<STRONG>date</STRONG> # Print the date and time
|
|
|
|
<STRONG>date</STRONG> <STRONG>0221921610</STRONG> # Set date to Feb 21, 1992 at 4:10 p.m.
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
|
|
With the <STRONG>-q</STRONG> flag or a numeric argument, <EM>date</EM> sets the GMT time and date.
|
|
<EM>MMDDYY</EM> refers to the month, day, and year; <EM>hhmmss</EM> refers to the hour,
|
|
minute and second. Each of the six fields must be exactly two digits, no
|
|
more and no less. <EM>date</EM> always display the date and time, with the
|
|
default format for the system. The <STRONG>-u</STRONG> flag request GMT time instead of
|
|
local time. A format may be specified with a + followed by a printf-like
|
|
string with the following options:
|
|
|
|
%% % character
|
|
%A Name of the day
|
|
%B Name of the month
|
|
%D mm/dd/yy
|
|
%H Decimal hour on 2 digits
|
|
%I Decimal hour modulo 12 on 2 digits
|
|
%M Decimal minute on 2 digits
|
|
%S Decimal seconds on 2 digits
|
|
%T HH:MM:SS
|
|
%U Decimal week number, Sunday being first day of week
|
|
%W Decimal week number, Monday being first day of week
|
|
%X Same as %T
|
|
%Y Decimal year on 4 digits
|
|
%Z Time Zone (if any)
|
|
%a Abbreviated name of the day
|
|
%b Abbreviated name of the month
|
|
%c Appropriate date & time (default format)
|
|
%d Decimal day of the month on 2 digits
|
|
%e Same as %d, but a space replaces leading 0
|
|
%h Same as %b
|
|
%j Decimal dey of the year on 3 digits
|
|
%m Decimal month on 2 digits
|
|
%n Newline character
|
|
%p AM or PM
|
|
%r 12-hour clock time with AM/PM
|
|
%s Number of seconds since the epoch
|
|
%t Tab character
|
|
%w Decimal day of the week (0=Sunday)
|
|
%x Same as %D
|
|
%y Decimal year on 2 digits
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man2/time.2.html">time(2)</A></STRONG>, <STRONG><A HREF="../man3/ctime.3.html">ctime(3)</A></STRONG>, <STRONG><A HREF="../man8/readclock.8.html">readclock(8)</A></STRONG>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|