Sun Java System Calendar Server 6.3 WCAP Developer's Guide

get_all_timezones.wcap

Purpose

Retrieve data about all time zones supported by the server.

Parameters

Table 3–18 get_all_timezones Parameters

Parameter  

Type  

Purpose  

Required  

Default  

dtend

Date Time string 

End date of the crossover values to retrieve. 

A value of 0 means get all crossover dates until the last known year (2087).

0

dtstart

Date Time string 

Start date of crossover values to retrieve. 

A value of 0 means get all crossover dates from the first known year (1987).

0

fmt-out

string 

The format for the returned data. 

Two format types: 

text/calendar

text/xml

text/calendar

id

unique identifier string 

The session identifier. 

N/A 

Description

Use this command to retrieve data about all time zones that are supported by the server. The crossover values are defined to be the dates when the time zone enters/exits daylight savings time. The odd index dates are the beginning of daylight-savings. The even index dates are the end of daylight-savings. If the time zone does not have daylight-savings, then this value is set to the empty-string.

Returns

If you specify a range of years with the dtstart and dtend parameters, the command returns only the crossover dates for the years within the range. Otherwise, it returns all crossover dates from the first to the last known year (1987-2087).

The server returns data in the format specified by the fmt-out parameter. If you do not pass in the fmt-out parameter, the server uses the default text/calendar format.

Error Codes

If there was an error in getting the time zones, the server returns the error FAILED: GET_ALL_TIMEZONES_FAILED (24).

Example

The first example shows the command output. The second example is a crossover array.

Example 1

This query gets all time zones.

http://calendarserver/get_all_timezones.wcap
                     ?id=2m2ns6w9x9h2mr6p3b
                     &fmt-out=text/calendar

This is the result of the query:

BEGIN:VCALENDAR
PRODID:-//SunONE/Calendar Hosting Server//EN
METHOD:PUBLISH
VERSION:6.0
 X-NSCP-CALPROPS-LAST-MODIFIED:19700101T000000Z
X-NSCP-CALPROPS-CREATED:19700101T000000Z
X-NSCP-CALPROPS-READ:999
X-NSCP-CALPROPS-WRITE:999
X-NSCP-CALPROPS-RELATIVE-CALID:default
X-NSCP-CALPROPS-LANGUAGE:en
X-NSCP-CALPROPS-PRIMARY-OWNER:jdoe
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^a^r^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^c^wdeic^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^a^sf^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^c^^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^p^r^g
X-NSCP-CALPROPS-RESOURCE:0
BEGIN:VTIMEZONE
TZID:Africa/Amman
BEGIN:STANDARD
DTSTART:19950920T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
TZNAME:EEST
RRULE:FREQ=YEARLY;BYDAY=-1FR;BYMONTH=9
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19930420T000000
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
TZNAME:EEDT
RRULE:FREQ=YEARLY;BYDAY=-1FR;BYMONTH=4
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VTIMEZONE
TZID:Africa/Cairo
BEGIN:STANDARD
DTSTART:19950924T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
TZNAME:EEST
COMMENT:this is a comment
RRULE:FREQ=YEARLY;BYDAY=-1FR;BYMONTH=9
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19950420T000000
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
TZNAME:EEDT
RRULE:FREQ=YEARLY;BYDAY=-1FR;BYMONTH=4
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VTIMEZONE

...

other time zones omitted to conserve space

...

BEGIN:VTIMEZONE
TZID:Pacific/Tongatapu
BEGIN:STANDARD
DTSTART:19970101T000000
TZOFFSETFROM:+1300
TZOFFSETTO:+1300
TZNAME:TOT
TZNAME:PHOT
END:STANDARD
END:VTIMEZONE
X-NSCP-WCAP-ERRNO:0
END:VCALENDAR

Example 2

The following is an example of a time zone array element where crossover dates have been limited to the years from mid-1998 to 2006:

timezoneList[20] = new TZ(\qAmerica/Los_Angeles\q,
\qPST\q,
\qPDT\q,
\q-0800\q,
\q-0700\q,
new Array
(\q19981025T090000Z\q,\q20020404T100000Z\q,\q20021031T090000Z\q,
\q20020402T100000Z\q,\q20021029T090000Z\q,\q20020401T100000Z\q,
\q20021028T090000Z\q, \q20020407T100000Z\q, \q20021027T090000Z\q,
\q20030406T100000Z\q, \q20031026T090000Z\q, \q20040404T100000Z\q,
\q20041031T090000Z\q, \q20050403T100000Z\q, \q20051030T090000Z\q,
 \q20060402T100000Z\q, \q20061029T090000Z\q))

The “America/Phoenix” time zone does not have daylight-savings. Thus the daylight elements exactly equal the standard elements. Also, the crossover strings are set to the empty string.

timezoneList[23] = new TZ(’America/Phoenix’,
                                        ’MST’,
                                        ’MST’,
                                        ’-0700’,
                                        ’-0700’,
                                        new Array())