Package Overview
The Date package provides an API to manipulate PrgT_Date objects. These objects represent a specific date and time as the number of seconds since midnight on 1 January 1970 GMT. Except where stated otherwise, all calculations are performed assuming local time; no time zone conversions occur.
prg_date_current_get() returns the current date and time.
You can perform various conversions on PrgT_Date objects:
- Convert to and from standard (time_t) time with
prg_date_to_standard_convert()andprg_date_from_standard_convert(). - Convert to and from a string representation (in standard C format) with
prg_date_to_string_convert()andprg_date_from_string_convert(). - Convert to and from a string representation, including time zone conversion, with
prg_date_to_string_convert_tz()andprg_date_from_string_convert_tz(). - Convert two dates to a date range, without or with time zone conversion, with
prg_date_range_to_string_convert()andprg_date_range_to_string_convert_tz().
You can add an offset (in seconds) to a time with prg_date_offset_add() or offset the time by a specific interval (such as an hour or a day) with prg_date_interval_offset_add(). To get the difference between two times, use prg_date_offset_get().
prg_date_time_window_calculate() will compute a time window of a requested size relative to a specified time.
Several utility functions perform operations that can simplify time-based computations: prg_date_month_number_determine(), prg_date_timezone_get(), and prg_date_utc_compute().