www.delorie.com/gnu/docs/sh-utils/sh-utils_57.html   search  
 
Buy GNU books!


GNU shell utilities

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.1 date: Print or set system date and time

date with no arguments prints the current time and date, in the format of the `%c' directive (described below). Synopses:

 
date [option]... [+format]
date [-u|--utc|--universal] 
[ MMDDhhmm[[CC]YY][.ss] ]

If given an argument that starts with a `+', date prints the current time and date (or the time and date specified by the --date option, see below) in the format defined by that argument, which is the same as in the strftime function. Except for directives, which start with `%', characters in the format string are printed unchanged. The directives are described below.

10.1.1 Time directives  %[HIklMprsSTXzZ]
10.1.2 Date directives  %[aAbBcdDhjmUwWxyY]
10.1.3 Literal directives  %[%nt]
10.1.4 Padding  Pad with zeroes, spaces (%_), or nothing (%-).
10.1.5 Setting the time  Changing the system clock.
10.1.6 Options for date  Instead of the current time.
10.1.7 Examples of date  Examples.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003