ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahz_5.4.0.1/date.htm

184 lines
3.8 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8">
<title>date - Write the date and time</title>
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</HEAD>
<body bgcolor="#FFFFFF">
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h2>date - Write the date and time</h2>
<strong>Synopsis</strong>
<p><strong>date [-u]</strong> [<em>+format</em>]</p>
<p><strong>Description</strong></p>
<p>The <strong>date</strong> utility writes the date and time to
standard output. By default, the current date and time are
written.</p>
<p><strong>Options</strong></p>
<dl>
<dt><strong>-u</strong></dt>
<dd>Give time in universal coordinated time (UTC). The QUTCOFFSET
system value must be set correctly for <strong>date</strong> to
return the correct time.</dd>
</dl>
<p><strong>Operands</strong></p>
<p>The <em>+format</em> operand specifies the format of the output
from the <strong>date</strong> command. Each field descriptor is
replaced in the standard output by its corresponding value. All
other characters are copied to the output without change. The
output is always terminated with a newline character.</p>
<p>You can use these field descriptors:</p>
<dl>
<dt><strong>%a</strong></dt>
<dd>Insert abbreviated weekday name from locale.</dd>
<dt><strong>%A</strong></dt>
<dd>Insert full weekday name from locale.</dd>
<dt><strong>%b</strong></dt>
<dd>Insert abbreviated month name from locale.</dd>
<dt><strong>%B</strong></dt>
<dd>Insert full month name from locale.</dd>
<dt><strong>%c</strong></dt>
<dd>Insert date and time from locale.</dd>
<dt><strong>%d</strong></dt>
<dd>Insert day of the month (01-31).</dd>
<dt><strong>%H</strong></dt>
<dd>Insert hour (24-hour clock) as a decimal number (00-23).</dd>
<dt><strong>%I</strong></dt>
<dd>Insert hour (12-hour clock) as a decimal number (01-12).</dd>
<dt><strong>%j</strong></dt>
<dd>Insert day of the year (001-366).</dd>
<dt><strong>%m</strong></dt>
<dd>Insert month (01-12).</dd>
<dt><strong>%M</strong></dt>
<dd>Insert minute (00-59).</dd>
<dt><strong>%p</strong></dt>
<dd>Insert equivalent of either AM or PM from locale.</dd>
<dt><strong>%S</strong></dt>
<dd>Insert second (00-61).</dd>
<dt><strong>%U</strong></dt>
<dd>Insert week number of the year (00-53) where Sunday is the
first day of the week.</dd>
<dt><strong>%w</strong></dt>
<dd>Insert weekday (0-6) where Sunday is 0. first day of the
week.</dd>
<dt><strong>%W</strong></dt>
<dd>Insert week number of the year (00-53) where Monday is the
first day of the week</dd>
<dt><strong>%x</strong></dt>
<dd>Insert date representation from locale.</dd>
<dt><strong>%X</strong></dt>
<dd>Insert time representation from locale.</dd>
<dt><strong>%y</strong></dt>
<dd>Insert year without the century (00-99).</dd>
<dt><strong>%Y</strong></dt>
<dd>Insert year.</dd>
<dt><strong>%Z</strong></dt>
<dd>Insert name of time zone, or no characters if time zone is not
available.</dd>
<dt><strong>%%</strong></dt>
<dd>Insert %.</dd>
</dl>
<p><strong>Exit Status</strong></p>
<ul>
<li>0 when successful</li>
<li>&gt;0 when an error occurred</li>
</ul>
<strong>Examples</strong>
<ol>
<li>Print the full weekday name, the full month name, the day and
the full year.
<pre>
date +@(#) 89 1.41@(#), 0 %d%, %Y
Friday, August 14, 1998
</pre>
</li>
<li>Print the day, the abbreviated month name, and the abbreviated
year.
<pre>
date +%d%.%b%.%y
14.Aug.98
</pre>
</li>
<li>Print the numeric month, day, and abbreviated year.
<pre>
date +%m%/%d%/%y
08/14/98
</pre>
</li>
</ol>
<!-- end ibmbody========================================================= -->
</body>
</html>