home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

  Previous section   Next section

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.

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 and ignores case and punctuation when interpreting them.

Some of the time-zone abbreviations CVS recognizes are ambiguous. CVS recognizes only one meaning for each of the ambiguous time zones. However, which meaning is recognized may vary depending on your operating system, and on how CVS was configured when it was compiled.

Table 11-1 shows the valid civilian time-zone abbreviations for CVS. Table 11-2 shows military time-zone abbreviations that CVS recognizes.

Table 11-1. Civilian time-zone abbreviations

gmt

+0000 Greenwich Mean

 

met

-0100 Middle European

ut

+0000 Coordinated Universal Time

 

mewt

-0100 Middle European Winter

utc

+0000 Coordinated Universal Time

 

mest

Middle European Summer

wet

+0000 Western European

 

swt

-0100 Swedish Winter

bst

+0000 British Summer (ambiguous with Brazil Standard)

 

sst

Swedish Summer (ambiguous with South Sumatra)

wat

+0100 West Africa

 

fwt

-0100 French Winter

at

+0200 Azores

 

fst

French Summer

bst

+0300 Brazil Standard (ambiguous with British Summer)

 

eet

-0200 Eastern Europe, USSR Zone 1

gst

+0300 Greenland Standard (ambiguous with Guam Standard)

 

bt

-0300 Baghdad, USSR Zone 2

nft

+0330 Newfoundland

 

it

-0330 Iran

nst

+0330 Newfoundland Standard (ambiguous with North Sumatra)

 

zp4

-0400 USSR Zone 3

ndt

Newfoundland Daylight

 

zp5

-0500 USSR Zone 4

ast

+0400 Atlantic Standard

 

ist

-0530 Indian Standard

adt

Atlantic Daylight

 

zp6

-0600 USSR Zone 5

est

+0500 Eastern Standard

 

nst

-0630 North Sumatra (ambiguous with Newfoundland Summer)

edt

Eastern Daylight

 

sst

-0700 South Sumatra, USSR Zone 6 (ambiguous with Swedish Summer)

cst

+0600 Central Standard

 

wast

-0700 West Australian Standard

cdt

Central Daylight

 

wadt

West Australian Daylight

mst

+0700 Mountain Standard

 

jt

-0730 Java

mdt

Mountain Daylight

 

cct

-0800 China Coast, USSR Zone 7

pst

+0800 Pacific Standard

 

jst

-0900 Japan Standard, USSR Zone 8

pdt

Pacific Daylight

 

cast

-0930 Central Australian Standard

yst

+0900 Yukon Standard

 

cadt

Central Australian Daylight

ydt

Yukon Daylight

 

east

-1000 Eastern Australian Standard

hst

+1000 Hawaii Standard

 

eadt

Eastern Australian Daylight

hdt

Hawaii Daylight

 

gst

-1000 Guam Standard, USSR Zone 9 (ambigous with Greenland Standard)

cat

+1000 Central Alaska

 

nzt

-1200 New Zealand

ahst

+1000 Alaska-Hawaii Standard

 

nzst

-1200 New Zealand Standard

nt

+1100 Nome

 

nzdt

New Zealand Daylight

idlw

+1200 International Date Line West

 

idle

-1200 International Date Line East

cet

-0100 Central European

     

Table 11-2. Military time-zone abbreviations

a

+0100

 

f

+0600

 

l

+1100

 

q

-0400

 

v

-0900

b

+0200

 

g

+0700

 

m

+1200

 

r

-0500

 

w

-1000

c

+0300

 

h

+0800

 

n

-0100

 

s

-0600

 

x

-1100

d

+0400

 

i

+0900

 

o

-0200

 

t

-0700

 

y

-1200

e

+0500

 

k

+1000

 

p

-0300

 

u

-0800

 

z

0000


  Previous section   Next section
Top