Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 965e33040dd61030a94f0eb89877aee8 > files > 675

howto-html-en-20080722-2mdv2010.1.noarch.rpm

<HTML
><HEAD
><TITLE
>Date and Time</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Bash Prompt HOWTO"
HREF="index.html"><LINK
REL="UP"
TITLE="Prompt Code Snippets"
HREF="c679.html"><LINK
REL="PREVIOUS"
TITLE="Built-in Escape Sequences"
HREF="x686.html"><LINK
REL="NEXT"
TITLE="Counting Files in the Current Directory"
HREF="x700.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Bash Prompt HOWTO: </TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x686.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 11. Prompt Code Snippets</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x700.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN690"
></A
>11.2. Date and Time</H1
><P
>If you don't like the built-ins for date and time, extracting the same
information from the <TT
CLASS="USERINPUT"
><B
>date</B
></TT
> command is relatively
easy.  Examples already seen in this HOWTO include 
<TT
CLASS="USERINPUT"
><B
>date +%H%M</B
></TT
>,
which will put in the hour in 24 hour format, and the minute.  
<TT
CLASS="USERINPUT"
><B
>date "+%A, %d %B %Y"</B
></TT
> will give something like 
"<TT
CLASS="COMPUTEROUTPUT"
>Sunday, 06 June 1999</TT
>".  For a full list
of the interpreted sequences, type <TT
CLASS="USERINPUT"
><B
>date --help</B
></TT
> or 
<TT
CLASS="USERINPUT"
><B
>man date</B
></TT
>.  &#13;</P
><P
>Relative speed: "date ..." takes about 0.12 seconds on an unloaded 486SX25.&#13;</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x686.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x700.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Built-in Escape Sequences</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c679.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Counting Files in the Current Directory</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>