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


GNU shell utilities

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

10.1.6 Options for date

The program accepts the following options. Also see 2. Common options.

`-d datestr'
`--date=datestr'
Display the time and date specified in datestr instead of the current time and date. datestr can be in almost any common format. It can contain month names, timezones, `am' and `pm', `yesterday', `ago', `next', etc. See section 3. Date input formats.

`-f datefile'
`--file=datefile'
Parse each line in datefile as with `-d' and display the resulting time and date. If datefile is `-', use standard input. This is useful when you have many dates to process, because the system overhead of starting up the date executable many times can be considerable.

`-I[timespec]'
`--iso-8601[=timespec]'
Display the date using the ISO 8601 format, `%Y-%m-%d'.

The optional argument timespec specifies the number of additional terms of the time to include. It can be one of the following:

`auto'
The default behavior: print just the date.

`hours'
Append the hour of the day to the date.

`minutes'
Append the hours and minutes.

`seconds'
Append the hours, minutes, and seconds.

If showing any time terms, then include the time zone using the format `%z'. If `--utc' is also specified, use `%Z' in place of `%z'.

`-R'
`--rfc-822'
Display the time and date using the RFC-822-specified format, `%a, %_d %b %Y %H:%M:%S %z'. If `--utc' is also specified, use `GMT' in place of `%z'.

`-r file'
`--reference=file'
Display the time and date reference according to the last modification time of file, instead of the current time and date.

`-s datestr'
`--set=datestr'
Set the time and date to datestr, See `-d' above.

`-u'
`--utc'
`--universal'
Print or set the time and date in Universal Coordinated Time instead of in local (wall clock) time.


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

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