From GridLAB-D Wiki
Jump to: navigation, search

timezone - Set the timezone for the simulation

Synopsis

clock {
  timezone tz-spec;
}

Description

The timezone clock directive determines which timezone to use during the simulation. The timezone must be known before any timestamps can be interpreted. The timezone rules are used to determine the offset from UTC for all time calculations, as well as determine daylight or summer time shifts.

Prior to Hassayampa (Version 3.0)
If the timezone is not set, the system will assume all timestamps are in UTC.
As of Hassayampa (Version 3.0)
If the timezone is not set, the system will assume all timestamps are in local time.

Time zones are specified using the POSIX timezone standard.

GLM

The timezone is usually set using the clock directive as follows:

 clock {
   timezone PST8PDT;
   starttime '2000-01-01 00:00:00 PST';
   stoptime '2001-01-01 00:00:00 PST';
 }

Command line

The timezone can be set using the command line:

host% export TZ=PST8PDT

On Windows machines, the syntax is

C:\> set TZ=PST8PDT

If the timezone is not set either using a clock directive or the TZ environment variable, GridLAB-D may be unable to interpret timestamps and fatal errors may occur.

Locale names

As of Hassayampa (Version 3.0) you may use locale names instead of the timezone codes. Locale names are listed in the tzinfo file and take the form

Country/Region/City


For example, instead of coding

timezone PST+8PDT;

you can code

timezone US/CA/Los Angeles;

For a listing of country and region codes, see ISO Std 3166-2.

Timezones and daylight-savings/summer time rules can be found at www.worldtimezone.com.

Version

Prior to Hassayampa (Version 3.0)
Only US timezones were distributed with GridLAB-D. City names are not supported.
As of Hassayampa (Version 3.0)
All officially recognized international timezones are implemented. Many city names are supported. The list of recognized cities and timezones can be found in the timezone file.

Caveats

Most Asia and Africa timezones are not yet implemented in the timezone file.

It is not clear whether 1/2 and 1/4 hours offset timezones always work properly.

Many of the historical rules for summer time around the world are not supported. In some cases the current summer time rules may be inappropriately applied to past years.

See also