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

21.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, time zones, `am' and `pm', `yesterday', `ago', `next', etc. See section 27. 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 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 timespec is omitted with `--iso-8601', the default is `auto'. On older systems, GNU date instead supports an obsolete option `-I[timespec]', where timespec defaults to `auto'. POSIX 1003.1-2001 (see section 2.5 Standards conformance) does not allow `-I' without an argument; use `--iso-8601' instead.

`-R'
`--rfc-822'
Display the time and date using the RFC-822-conforming format, `%a, %_d %b %Y %H:%M:%S %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'
Use Coordinated Universal Time (UTC) by operating as if the TZ environment variable were set to the string `UTC0'. Normally, date operates in the time zone indicated by TZ, or the system default if TZ is not set. Coordinated Universal Time is often called "Greenwich Mean Time" (GMT) for historical reasons.


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

This document was generated by Jeff Bailey on December, 28 2002 using texi2html