PascalTZ uses the Time Zone Database (often called
zoneinfo) to determine how to correctly adjust time for various time zones. The correctness of time zone conversions in future relies on using an up to date database. Beware, time zone rules may be changed by governments around the world, sometimes with a very short notice.
This code is based on PascalTZ originally published by José Mejuto in 2009.
The maintenance of this package has been taken up by Denis Kozlov in 2015 with key goals:
- Identify and fix all data parsing and time zone conversion problems (yes, plenty).
- Refactor the existing code to make debugging and maintenance easier.
- Expand functionality for more user-friendly workflows.
- Add test cases and a test framework.
See CHANGELOG.md for a list of major changes between versions.
uPascalTZunit to the uses clause of your project.
- Create an instance of
- Load the time zone database into an instance of
- Download and unpack the latest Time Zone Database, i.e.
DatabasePathproperty to the location of your time zone database.
LocalTimeToGMTand other methods to convert date and time between various time zones.
A testing framework consists of the following ingredients:
- Test runner project located in
- Test vectors for time zone conversions located in
- Test cases (FPCUnit based) for provided test vectors and internal functions.
- PHP script to generate test vectors, and test time zone conversions using PHP and MySQL implementations.
Running the test project requires the time zone database to be available in the
Steps for preparing a new release.
- Update version number in package/pascaltz.lpk.
- Update CHANGELOG.md.
- Commit, tag with the version number (e.g.
v1.2.3), push to origin.
- Update version number and download link in opm/update.json.
- Commit, push to origin.
Version numbers must adhere to the semantic versioning specification.
- 2009 - José Mejuto
- 2015 - Denis Kozlov