This repository contains two C libraries:
- TimeZoneDatabaseCreator: This library extracts time zone data from the IANA time zone database and generates C code files for use in embedded systems.
- TimeZoneOffsetCalculator: This library calculates time zone offsets based on the generated data.
- Microsoft Visual Studio 2022 (Version 17.12.0 or later) is recommended for building the
TimeZoneDatabaseCreator
. - A C compiler for the target platform of your embedded system.
- Download the latest Data Only Distribution from https://www.iana.org/time-zones.
- Extract the downloaded archive to a suitable location.
- Open the
TimeZoneDatabaseCreator
solution in Visual Studio. - Configure the project to point to the extracted IANA time zone database.
- Build the solution.
- Include the generated C code files and the
TimeZoneOffsetCalculator
library in your project. - Link your project with the
TimeZoneOffsetCalculator
library. - Use the provided functions to calculate time zone offsets based on a given date and time.
- IANA Time Zone Database: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- tz database: https://github.com/eggert/tz
Disclaimer: This library is under active development and may contain bugs or limitations.