php-internal-docs 8.4.8
Unofficial docs for php/php-src
|
Go to the source code of this file.
Macros | |
#define | TIMELIB_SUPPORTS_V2DATA |
#define | TIMELIB_SUPPORT_SLIM_FILE |
#define | timelib_conv_int_signed(value) |
#define | timelib_conv_int64_signed(value) |
Definition at line 92 of file parse_tz.c.
Definition at line 91 of file parse_tz.c.
#define TIMELIB_SUPPORT_SLIM_FILE |
Definition at line 30 of file parse_tz.c.
#define TIMELIB_SUPPORTS_V2DATA |
Definition at line 29 of file parse_tz.c.
const timelib_tzdb * timelib_builtin_db | ( | void | ) |
Returns a pointer to the built-in time zone database.
You must not free the returned pointer as it is part of the text segment.
Definition at line 606 of file parse_tz.c.
void timelib_dump_tzinfo | ( | timelib_tzinfo * | tz | ) |
Displays debugging information about the time zone information in 'tz'.
Definition at line 510 of file parse_tz.c.
ttinfo * timelib_fetch_timezone_offset | ( | timelib_tzinfo * | tz, |
timelib_sll | ts, | ||
timelib_sll * | transition_time ) |
Algorithm From RFC 8536, Section 3.2 https://tools.ietf.org/html/rfc8536#section-3.2
Definition at line 790 of file parse_tz.c.
timelib_sll timelib_get_current_offset | ( | timelib_time * | t | ) |
Returns the UTC offset currently applicable for the information stored in 't'.
The value returned is the UTC offset in seconds East.
Definition at line 937 of file parse_tz.c.
timelib_time_offset * timelib_get_time_zone_info | ( | timelib_sll | ts, |
timelib_tzinfo * | tz ) |
Returns offset information with time zone 'tz' for the time stamp 'ts'.
The returned information contains: the offset in seconds East of UTC (in 'offset'), whether DST is active ('is_dst'), what the current time zone abbreviation is ('abbr') and the transition time that got to this state (in 'transition_time');
Definition at line 881 of file parse_tz.c.
int timelib_get_time_zone_offset_info | ( | timelib_sll | ts, |
timelib_tzinfo * | tz, | ||
int32_t * | offset, | ||
timelib_sll * | transition_time, | ||
unsigned int * | is_dst ) |
Returns offset information with time zone 'tz' for the time stamp 'ts'.
The returned information contains: the offset in seconds East of UTC (in the output parameter 'offset'), whether DST is active (in the output parameter 'is_dst'), and the transition time that got to this state (in the output parameter 'transition_time'); if NULL is passed, the value is not retrieved
Returns 1 if successful, 0 for failure.
Definition at line 913 of file parse_tz.c.
timelib_tzinfo * timelib_parse_tzfile | ( | const char * | timezone, |
const timelib_tzdb * | tzdb, | ||
int * | error_code ) |
Converts the binary stored time zone information from 'tzdb' for the time zone 'timezone' into a structure the library can use for calculations.
The function can be used on both timelib_builtin_db as well as a time zone db as opened by timelib_zoneinfo.
'error_code' must not be a null pointer, and will always be written to. If the value is TIMELIB_ERROR_NO_ERROR then the file was parsed without problems.
The function will return null upon failure, and also set an error code through 'error_code'.
The error code is one of the TIMELIB_ERROR_* constants as listed above. These error constants can be converted into a string by timelib_get_error_message.
If the function returns not-null, the 'error_code' might have a non-null value that can be used to detect incompatibilities. The only one that is currently detected is whether the file is a 'slim' file, in which case 'error_code' will be set to TIMELIB_ERROR_SLIM_FILE.
This function allocates memory for the new time zone structure, which must be freed after use. Although it is recommended that a cache of each used time zone is kept.
Definition at line 662 of file parse_tz.c.
int timelib_same_timezone | ( | timelib_time * | one, |
timelib_time * | two ) |
Returns whether the timezone information in *one and *two are the same
A timezone is considered the same if:
Definition at line 955 of file parse_tz.c.
int timelib_timestamp_is_in_dst | ( | timelib_sll | ts, |
timelib_tzinfo * | tz ) |
Returns whether DST is active with time zone 'tz' for the time stamp 'ts'.
Returns 0 if DST is not active, 1 if DST is active, or -1 if no transitions were available through 'tz'.
Definition at line 870 of file parse_tz.c.
int timelib_timezone_id_is_valid | ( | const char * | timezone, |
const timelib_tzdb * | tzdb ) |
Returns whether the time zone ID 'timezone' is available in the time zone database as pointed to be 'tzdb'.
Definition at line 617 of file parse_tz.c.
const timelib_tzdb_index_entry * timelib_timezone_identifiers_list | ( | const timelib_tzdb * | tzdb, |
int * | count ) |
Returns a pointer to the start of an array containing a list of timezone identifiers.
The amount of entries in the array is returned through the 'count' OUT parameter.
Each entry contains the time zone ID ('id' field), and the position within the time zone information ('pos' field). The pos field should not be used.
Definition at line 611 of file parse_tz.c.
timelib_tzinfo * timelib_tzinfo_clone | ( | timelib_tzinfo * | tz | ) |
Deep-clones a timelib_tzinfo structure.
This allocates resources that need to be freed with 'timelib_tzinfo_dtor'
Definition at line 745 of file parse_tz.c.
void timelib_tzinfo_dtor | ( | timelib_tzinfo * | tz | ) |
Frees up the resources allocated by 'timelib_parse_tzfile'.
Definition at line 728 of file parse_tz.c.