Module Calendar.Timezone


This module contains all the predefined timezones. Index it with whatever timezone you want to use.

Example: Calendar.Calendar my_cal= Calendar.ISO->set_timezone(Calendar.Timezone["Europe/Stockholm"]);

A simpler way of selecting timezones might be to just give the string to set_timezone; it indexes by itself:

Calendar.Calendar my_cal= Calendar.ISO->set_timezone("Europe/Stockholm");


Do not confuse this module with Ruleset.Timezone, which is the base class of a timezone object.

"CET" and some other standard abbreviations work too, but not all of them (due to more then one country using them).

Do not call set_timezone too often, but remember the result if possible. It might take some time to initialize a timezone object.

There are about 504 timezones with 127 different daylight saving rules. Most of them historic.

The timezone information comes from and are not made up from scratch. Timezone bugs may be reported to the timezone mailing list,, preferable with a cc to /Mirar

See also


Constant locale

constant Calendar.Timezone.locale = Rule.Timezone


This contains the local timezone, found from various parts of the system, if possible.

Constant localtime

constant Calendar.Timezone.localtime = Rule.Timezone


This is a special timezone, that uses localtime() and tzname to find out what current offset and timezone string to use.

locale uses this if there is no other way of finding a better timezone to use.

This timezone is limited by localtime and libc to the range of time_t, which is a MAXINT on most systems - 13 Dec 1901 20:45:52 to 19 Jan 2038 3:14:07, UTC.