Resources | Resources |



Configuring timezone data with tzdbgen.exe

This section explains configuring timezone data and how to use tzdbgen.exe.

Configuring timezone data

The Olson database contains a huge amount of timezone information, most of which may not be applicable or even practical to have on a mobile handset. For this reason, the timezonedatabase generation tool takes a list of Olson timezonenames to Microsoft Windows timezonename mapping table as input to determine which timezones need to be included in the timezonedatabase file that will be placed on the mobile device. A default mapping file is provided (Olson-to-Windows.txt). This file contains the Olson timezonename (tzid) separated by the friendly name (usually corresponding to the name in Microsoft Windows registry) followed by a range of years for which timezonetransition rules need to be included. For example:

America/Los_Angeles|Pacific Standard Time;2006-2008
Asia/Taipei|Taipei Standard Time;2008-2008
Asia/Jerusalem|Israel Standard Time;2004-2023
Europe/London|GMT Standard Time;2008-2008

It is very important to keep the date range short enough to have the most relevant timezonetransition rules because increasing the date range also increases the size of the timezonedatabase on the handset.

Using the tool

Usage: tzdbgen.exe -d  [-l ] [-w] -z  -m 


-d   (Mandatory)    The fs root directory. The tool uses this location to find
the dbc and TimeZone modules and to generate the tz database.

-l   (Optional)     Language code for TimeZone strings. The language is a
sequence of four characters consisting of the ISO 639-1 language code
(2 characters) followed by the ISO 3166 A2 country code (2 characters). If no
country code is needed to specify the language (Korean, for example), two
spaces are used in place of the country code. 'en  ', 'enus', 'engb' and 'ko  '
are valid examples of language codes. The default language is 'en  '.

-w   (Optional)     Generate data for only the TimeZone supported by Microsoft
Windows. Use this option to generate information for the most common TimeZones.

-z   (Mandatory)    Zonetable file from Olson database. can be
obtained from the tzinfo database website.

-m   (Mandatory)    Mapping file for Olson database to Windows name. This is
supplied with the tool (Olson-to-Windows.txt)

-t   (Mandatory)    Olson database data directory. This can also be obtained
from the tzinfo database website.

-v   (Optional)     Version information.

-h   (Optional)     Usage information.