Next: , Previous: , Up: Common elements   [Contents][Index]


2.1.2 Date option

Some commands accept an option of the form ‘-ddate’ to specify a date, an absolute point in time (to second resolution), expressed in a date format. These also accept ‘-zzone’ to specify the timezone. The special value ‘LT’ stands for the local time zone. RCS recognizes many date formats and time zones. For example, the following dates are equivalent if local time is January 11, 1990, 8pm Pacific Standard Time, eight hours west of Coordinated Universal Time (UTC):

8:00 pm lt
4:00 AM, Jan. 12, 1990           default is UTC
1990-01-12 04:00:00+00           ISO 8601 (UTC)
1990-01-11 20:00:00-08           ISO 8601 (local time)
1990/01/12 04:00:00              traditional RCS format
Thu Jan 11 20:00:00 1990 LT      output of ctime(3) + LT
Thu Jan 11 20:00:00 PST 1990     output of date(1)
Fri Jan 12 04:00:00 GMT 1990
Thu, 11 Jan 1990 20:00:00 -0800  Internet RFC 822
12-January-1990, 04:00 WET

Most fields in the date and time can be defaulted. The default time zone is normally UTC, but this can be overridden by the -z option. The other defaults are determined in the order year, month, day, hour, minute, and second (most to least significant). At least one of these fields must be provided. For omitted fields that are of higher significance than the highest provided field, the time zone’s current values are assumed. For all other omitted fields, the lowest possible values are assumed. For example, without -z, the date ‘20, 10:30’ defaults to ‘10:30:00 UTC’ of the 20th of the UTC time zone’s current month and year. Note that for the shell, the date/time must be quoted if it contains spaces.

RCS also accepts some other formats which specify only the date portion (omitting the time portion). In the following table, year is the four-digit year YYYY, and all examples specify 20 April 2018.

formatexampledescription
year-doy2018-110doy is the day of year DDD, 1-366.
year-wweek-dow2018-w16-5week is the ISO week number WW, 0-53 (actually, ISO week numbers are 1-53; week 0 is a GNU RCS extension); and dow is the ISO day number D, 1-7 (Monday through Sunday). Note the literal w that precedes week.

Next: Description option, Previous: Revision options, Up: Common elements   [Contents][Index]