Section 11.4. Dates


11.4. Dates

In CVS, all dates and times are processed by a version of the GNU getdate function, which can translate dates and times given in several different formats. Case is always irrelevant when interpreting dates. Spaces are permitted in date strings, but in the command-line client, a string with spaces should be surrounded by quotes. If the year is 0 to 99, it is considered to be in the twentieth century.

If a time is not given, midnight at the start of the date is assumed. If a time zone is not specified, the date is interpreted as being in the client's local time zone.

For the canonical information on CVS and dates, see the information on getdate at http://www.gnu.org/software/shishi/manual/html_node/Date-input-formats.html.

11.4.1. Legal Date Formats

The legal time and date formats for CVS are defined by the ISO 8601 standard and RFC 822 as amended by RFC 1123. Other formats can be interpreted, but CVS is designed to handle only these standards.

11.4.1.1. ISO 8601

The basic ISO 8601 date format is as follows:

 year-month-day hours:minutes:seconds 

All values are numbers with leading zeros to ensure that the correct number of digits are used. Hours are given in 24-hour time. This produces the structure YYYY-MM-DD HH:MM:SS, which is internationally acceptable and can be sorted easily. You can use a date, a time, or both.

If you're using ISO 8601 format with the hyphens, the full date is required in CVS. The YYYYMMDD date format is also acceptable and can be abbreviated to YYYYMM or YYYY.

The HH and HH:MM time formats are acceptable. Times can also be specified without the colon, so HHMMSS or HHMM are usable.

Be aware that HHMM may be misinterpreted as YYYY. Get into the habit of using separators.


In strict ISO 8601 format, a T is required between the date and the time, but CVS understands this format with or without the T. The ISO 8601 standard also states that a Z at the end of the string designates UTC (Universal Coordinated Time), but CVS does not recognize the use of Z.

11.4.1.2. RFC 822 and RFC 1123

RFCs 822 and 1123 define a precise time format:

 [DDD ,] DD MMM YYYY HH:MM[:SS] ZZZ 

These are the terms in the format:


DDD

A three-letter day of the week


DD

A two-digit date of the month


MMM

A three-letter month


YYYY

The year (it must be a four-digit year)


HH

Hours


MM

Minutes


SS

Seconds


ZZZ

The time zone (can be the text abbreviation, a military time zone, or an offset from UTC in hours and minutes)

11.4.2. Legal Date Keywords

CVS also allows short English phrases such as "last Wednesday" and "a month ago" to be used in placed of actual dates. Case is not significant, and CVS can understand plurals. These are the keywords it understands:


Month names

January, February, March, April, May, June, July, August, September, October, November, and December


Month abbreviations

Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Sept, Oct, Nov, and Dec


Days of the week

Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday


Day abbreviations

Sun, Mon, Tue, Tues, Wed, Wednes, Thu, Thur, Thurs, Fri, and Sat


Units of time

year, month, fortnight, week, day, hour, minute, min, second, and sec


Relative times

tomorrow, yesterday, today, and now


Meridian qualifiers

am, pm, a.m., and p.m.


Modifiers

a, last, this, next, and ago


Sequences

first, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh, and twelfth (second can't be used as a sequence term, because it is used as a time unit)

11.4.3. Time Zones

CVS understands time zones expressed in offsets from UTC, such as +0700 (7 hours ahead) and -1130 (11 hours, 30 minutes behind). The format for these time zones is +HHMM or -HHMM, where + means ahead of UTC and - means behind UTC. CVS also understands time-zone abbreviations such as EST and ignores case and punctuation when interpreting them, but it is not recommended that you use them, as they can be ambiguous.

One source of information on time zones is at http://www.timeanddate.com/library/abbreviations/timezones/.




Essential CVS
Essential CVS (Essentials)
ISBN: 0596527039
EAN: 2147483647
Year: 2006
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net