DateLib (TM) feature overview
The DateLib is a portable library developed in ANSI-C/C++ with more than 100 functions for low level date and time calculations, including full source code. All functions are documented via Autodocs. Since the library has been written in ANSI-C/C++ it can not only be used with existing C/C++ programs but also with programming languages supporting a C interface.
General features:
- Portable ANSI-C/C++ source code
- Complete documentation in PDF format
- Additional code to create shared libraries / DLLs
- Additional debugging code
For date calculations the following features are available:
- Support for six different date/time-systems:
Julian calendar, Gregorian calendar, extension of the Gregorian calendar after N. Heis for a historical correct date range from the year 8 to the year 8000 (minimum), Julian Date, Modified Julian Date, Scaliger years. - Support of 28 languages (English, German, French, Spanish, Portuguese, Danish, Italian, Dutch, Norwegian, Swedish, Polish, Finnish, Hungarian, Greek, Esperanto, Turkish, Latin, Russian, Czech, Catalonian, Serbian, Slovenian, Slovak, Croatian, Bosnian, Esthonian, Persian, Japanese) for names of months, weekdays and some other date/time specific strings.
- Handling of the Gregorian calendar reform (in October 1582 ten days were removed from the calendar).
- Calculation of leap years.
- Calculating the number of days for a month, a year or between two dates.
- Calculation of the weeknumber and the weekday for a date.
- Verification if a date is valid.
- Calculation of the next valid date for an invalid value.
- Calculation of Easter Sunday - from which other holidays like Pentecost etc. will be calculated.
- Comparison of two date values.
- Powerful functions to handle differences between two dates (date + range = new date, date - date = range in days or in days, months and years).
- Conversion of date values from one calendar system into all others.
- Calculation of the age of the moon (within a month) and of the moonphase (new moon, full moon, quarter moon, three quarter moon).
- A week can start with any day of the week (Monday - Sunday).
- It's possible to expand two digit year values to four digits. Using the 'sliding window' technique it is possible to use this for any century.
- Conversion of weekday/week/year into day/ month/year and reverse.
- Very flexible formatting of a date into a string by using many formatting codes.
- Parsing of date strings via templates or via automatic analyses of more than 40 date-string-formats.
When calculating time, the following features are available:
- Verify the validity of time.
- Comparison of two time values.
- Conversion of the 24 hour time-format into seconds and reverse.
- Conversion of the 24 hour time-format into the Julian time-format and reverse.
- Calculating the local time zone from the correct position on the earth.
- Very flexible formatting of time (including time zone and dst) into a string via many formatting codes.
- Parsing of time strings (including time zone and dst) via templates or via automatic analyzing.
- Correct handling of the dst change days (summer to winter and reverse).
- Converting a date/time pair from local to GMT and vice versa while taking daylight saving time into account.