|
Adaptive Framework
0.9.0
|
Files | |
| file | afw_time.h |
| Header for Adaptive Framework Time Support. | |
Macros | |
| #define | AFW_TIME_SECONDS_TO_MICROSECONDS(SECONDS) (afw_integer_t)(SECONDS) * (afw_integer_t)1000000 |
| #define | AFW_TIME_MINUTES_TO_MICROSECONDS(MINUTES) |
| #define | AFW_TIME_HOURS_TO_MICROSECONDS(HOURS) |
| #define | AFW_TIME_DAYS_TO_MICROSECONDS(DAYS) |
Functions | |
| void | afw_date_set_from_parts (afw_date_t *date, int year, int month, int day, int tz_hours_offset, int tz_minutes_offset, afw_xctx_t *xctx) |
| Set afw_date_t from parts. More... | |
| const afw_date_t * | afw_date_create_from_parts (int year, int month, int day, int tz_hours_offset, int tz_minutes_offset, const afw_pool_t *p, afw_xctx_t *xctx) |
| Create afw_date_t from parts in specific pool. More... | |
| void | afw_dateTime_set_from_apr_time (afw_dateTime_t *dateTime, apr_time_t apr_time, afw_xctx_t *xctx) |
| Set afw_dateTime_t from apr_time. More... | |
| const afw_dateTime_t * | afw_dateTime_create_from_apr_time (apr_time_t apr_time, const afw_pool_t *p, afw_xctx_t *xctx) |
| Create afw_dateTime_t from apr time. More... | |
| void | afw_dateTime_set_from_parts (afw_dateTime_t *dateTime, int year, int month, int day, int hour, int minute, int second, int microsecond, int tz_hours_offset, int tz_minutes_offset, afw_xctx_t *xctx) |
| Set afw_dateTime_t from parts. More... | |
| const afw_dateTime_t * | afw_dateTime_create_from_parts (int year, int month, int day, int hour, int minute, int second, int microsecond, int tz_hours_offset, int tz_minutes_offset, const afw_pool_t *p, afw_xctx_t *xctx) |
| Create afw_dateTime_t from parts in specific pool. More... | |
| void | afw_dayTimeDuration_set_from_parts (afw_dayTimeDuration_t *dayTimeDuration, afw_boolean_t is_positive, int days, int hours, int minutes, int seconds, int microseconds, afw_xctx_t *xctx) |
| Set afw_dayTimeDuration_t from parts. More... | |
| const afw_dayTimeDuration_t * | afw_dayTimeDuration_create_from_parts (afw_boolean_t is_positive, afw_int32_t days, afw_int32_t hours, afw_int32_t minutes, afw_int32_t seconds, afw_int32_t microseconds, const afw_pool_t *p, afw_xctx_t *xctx) |
| Create afw_dayTimeDuration_t from parts in specific pool. More... | |
| void | afw_time_set_from_parts (afw_time_t *time, int hour, int minute, int second, int microsecond, int tz_hours_offset, int tz_minutes_offset, afw_xctx_t *xctx) |
| Set afw_time_t from parts. More... | |
| const afw_time_t * | afw_time_create_from_parts (int hour, int minute, int second, int microsecond, int tz_hours_offset, int tz_minutes_offset, const afw_pool_t *p, afw_xctx_t *xctx) |
| Create afw_time_t from parts in specific pool. More... | |
| void | afw_yearMonthDuration_set_from_parts (afw_yearMonthDuration_t *yearMonthDuration, afw_boolean_t is_positive, int years, int months, afw_xctx_t *xctx) |
| Set afw_yearMonthDuration_t from parts. More... | |
| const afw_yearMonthDuration_t * | afw_yearMonthDuration_create_from_parts (afw_boolean_t is_positive, afw_int32_t years, afw_int32_t months, const afw_pool_t *p, afw_xctx_t *xctx) |
| Create afw_yearMonthDuration_t from parts in specific pool. More... | |
| void | afw_dateTime_set_now (afw_dateTime_t *dateTime_local, afw_dateTime_t *dateTime_utc, afw_xctx_t *xctx) |
| Set local and/or utc dateTime to now. More... | |
| void | afw_time_set_now (afw_time_t *time_local, afw_time_t *time_utc, afw_xctx_t *xctx) |
| Set local and/or utc time to now. More... | |
| const afw_dateTime_t * | afw_dateTime_now_utc (const afw_pool_t *p, afw_xctx_t *xctx) |
| Get now time as dateTime in specified pool. More... | |
| const afw_time_t * | afw_time_now_utc (const afw_pool_t *p, afw_xctx_t *xctx) |
| Get now time as time only in specified pool. More... | |
| const afw_dateTime_t * | afw_dateTime_now_local (const afw_pool_t *p, afw_xctx_t *xctx) |
| Get now local time as dateTime in specified pool. More... | |
| const afw_time_t * | afw_time_now_local (const afw_pool_t *p, afw_xctx_t *xctx) |
| Get now local time as time only in specified pool. More... | |
| afw_integer_t | afw_time_to_microseconds_utc (const afw_time_t *time, afw_xctx_t *xctx) |
| Convert time normalize to utc to microseconds. More... | |
| int | afw_date_maximum_days_in_month (afw_integer_t year, afw_integer_t month) |
| Determine maximum days in a month. More... | |
| const afw_utf8_t * | afw_date_internal_to_utf8 (const afw_date_t *date, const afw_pool_t *p, afw_xctx_t *xctx) |
| Convert internal date to utf8 xml schema date in specified pool. More... | |
| void | afw_date_utf8_set_internal (const afw_utf8_t *utf8, afw_date_t *internal, afw_xctx_t *xctx) |
| Convert utf8 xml schema date to internal and set. More... | |
| const afw_utf8_t * | afw_dateTime_internal_to_utf8 (const afw_dateTime_t *dateTime, const afw_pool_t *p, afw_xctx_t *xctx) |
| Convert internal dateTime to utf8 xml schema dateTime in specified pool. More... | |
| void | afw_dateTime_utf8_set_internal (const afw_utf8_t *utf8, afw_dateTime_t *internal, afw_xctx_t *xctx) |
| Convert utf8 xml schema dateTime to internal and set. More... | |
| const afw_utf8_t * | afw_dayTimeDuration_internal_to_utf8 (const afw_dayTimeDuration_t *dayTimeDuration, const afw_pool_t *p, afw_xctx_t *xctx) |
| Convert internal dayTimeDuration to utf8 xml schema dayTimeDuration in specified pool. More... | |
| void | afw_dayTimeDuration_utf8_set_internal (const afw_utf8_t *utf8, afw_dayTimeDuration_t *internal, afw_xctx_t *xctx) |
| Convert utf8 xml schema dayTimeDuration to internal and set. More... | |
| const afw_utf8_t * | afw_time_internal_to_utf8 (const afw_time_t *time, const afw_pool_t *p, afw_xctx_t *xctx) |
| Convert internal time to utf8 xml schema time in specified pool. More... | |
| void | afw_time_utf8_set_internal (const afw_utf8_t *utf8, afw_time_t *internal, afw_xctx_t *xctx) |
| Convert utf8 xml schema dateTime to internal and set. More... | |
| const afw_utf8_t * | afw_yearMonthDuration_internal_to_utf8 (const afw_yearMonthDuration_t *yearMonthDuration, const afw_pool_t *p, afw_xctx_t *xctx) |
| Convert internal yearMonthDuration to utf8 xml schema yearMonthDuration in specified pool. More... | |
| void | afw_yearMonthDuration_utf8_set_internal (const afw_utf8_t *utf8, afw_yearMonthDuration_t *internal, afw_xctx_t *xctx) |
| Convert utf8 xml schema yearMonthDuration to internal and set. More... | |
| int | afw_date_compare (const afw_date_t *v1, const afw_date_t *v2, afw_xctx_t *xctx) |
| compare two date values. More... | |
| int | afw_dateTime_compare (const afw_dateTime_t *v1, const afw_dateTime_t *v2, afw_xctx_t *xctx) |
| compare two dateTime values. More... | |
| int | afw_time_compare (const afw_time_t *v1, const afw_time_t *v2, afw_xctx_t *xctx) |
| compare two time values. More... | |
| int | afw_dayTimeDuration_compare (const afw_dayTimeDuration_t *v1, const afw_dayTimeDuration_t *v2, afw_xctx_t *xctx) |
| compare two dateTime values. More... | |
| int | afw_yearMonthDuration_compare (const afw_yearMonthDuration_t *v1, const afw_yearMonthDuration_t *v2, afw_xctx_t *xctx) |
| compare two yearMonthDuration values. More... | |
| void | afw_date_add_yearMonthDuration (afw_date_t *date, const afw_yearMonthDuration_t *yearMonthDuration, afw_xctx_t *xctx) |
| Add yearMonthDuration to date. More... | |
| void | afw_date_subtract_yearMonthDuration (afw_date_t *date, const afw_yearMonthDuration_t *yearMonthDuration, afw_xctx_t *xctx) |
| Subtract yearMonthDuration from date. More... | |
| void | afw_dateTime_add_dayTimeDuration (afw_dateTime_t *dateTime, const afw_dayTimeDuration_t *dayTimeDuration, afw_xctx_t *xctx) |
| Add dayTimeDuration to dateTime. More... | |
| void | afw_dateTime_subtract_dayTimeDuration (afw_dateTime_t *dateTime, const afw_dayTimeDuration_t *dayTimeDuration, afw_xctx_t *xctx) |
| Subtract dayTimeDuration from dateTime. More... | |
| void | afw_dateTime_add_yearMonthDuration (afw_dateTime_t *dateTime, const afw_yearMonthDuration_t *yearMonthDuration, afw_xctx_t *xctx) |
| Add yearMonthDuration to dateTime. More... | |
| void | afw_dateTime_subtract_yearMonthDuration (afw_dateTime_t *dateTime, const afw_yearMonthDuration_t *yearMonthDuration, afw_xctx_t *xctx) |
| Subtract yearMonthDuration from dateTime. More... | |
| const afw_utf8_t * | afw_dateType_internal_to_generalized_time (const afw_dateTime_t *dateTime, const afw_pool_t *p, afw_xctx_t *xctx) |
| Convert internal dateTime to generalized time (see X.208) in specified pool. More... | |
| void | afw_dataType_generalized_time_set_internal (const afw_utf8_t *generalized_time, afw_dateTime_t *internal, afw_xctx_t *xctx) |
| Convert generalized time (see X.208) to internal and set. More... | |
Time support.
| #define AFW_TIME_DAYS_TO_MICROSECONDS | ( | DAYS | ) |
Definition at line 41 of file afw_time.h.
| #define AFW_TIME_HOURS_TO_MICROSECONDS | ( | HOURS | ) |
Definition at line 37 of file afw_time.h.
| #define AFW_TIME_MINUTES_TO_MICROSECONDS | ( | MINUTES | ) |
Definition at line 33 of file afw_time.h.
| void afw_dataType_generalized_time_set_internal | ( | const afw_utf8_t * | generalized_time, |
| afw_dateTime_t * | internal, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert generalized time (see X.208) to internal and set.
| generalized_time | (see X.208). |
| internal | is place to return internal representation. |
| xctx | of caller. |
Definition at line 2063 of file afw_time.c.
| void afw_date_add_yearMonthDuration | ( | afw_date_t * | date, |
| const afw_yearMonthDuration_t * | yearMonthDuration, | ||
| afw_xctx_t * | xctx | ||
| ) |
Add yearMonthDuration to date.
| date | pointer. |
| yearMonthDuration | to add to date. |
| xctx | of caller. |
Definition at line 1791 of file afw_time.c.
| int afw_date_compare | ( | const afw_date_t * | v1, |
| const afw_date_t * | v2, | ||
| afw_xctx_t * | xctx | ||
| ) |
compare two date values.
| v1 | is first value |
| v2 | is second value |
The time zones of both v1 and v2 must match or an error is thrown.
Definition at line 1517 of file afw_time.c.
| const afw_date_t* afw_date_create_from_parts | ( | int | year, |
| int | month, | ||
| int | day, | ||
| int | tz_hours_offset, | ||
| int | tz_minutes_offset, | ||
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Create afw_date_t from parts in specific pool.
| date | is pointer to preallocated afw_date_t. |
| year | including century. Negative is BC. No 0. |
| month | (1-12). |
| day | of month (1-31). Month limited to days in month.. |
| tz_hours_offset | Hours (-14 - +14). If +14 or -14, minutes must be 0. |
| tz_minutes_offset | Minutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0. |
| p | to use for result. |
| xctx | of caller. |
Definition at line 219 of file afw_time.c.
| const afw_utf8_t* afw_date_internal_to_utf8 | ( | const afw_date_t * | date, |
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert internal date to utf8 xml schema date in specified pool.
| p | pool to use for result. |
| xctx | of caller. |
Definition at line 1045 of file afw_time.c.
| int afw_date_maximum_days_in_month | ( | afw_integer_t | year, |
| afw_integer_t | month | ||
| ) |
Determine maximum days in a month.
| year | |
| month | which can exceed 12. |
Definition at line 1671 of file afw_time.c.
| void afw_date_set_from_parts | ( | afw_date_t * | date, |
| int | year, | ||
| int | month, | ||
| int | day, | ||
| int | tz_hours_offset, | ||
| int | tz_minutes_offset, | ||
| afw_xctx_t * | xctx | ||
| ) |
Set afw_date_t from parts.
| date | is pointer to preallocated afw_date_t. |
| year | including century. Negative is BC. No 0. |
| month | (1-12). |
| day | of month (1-31). Month limited to days in month.. |
| tz_hours_offset | Hours (-14 - +14). If +14 or -14, minutes must be 0. |
| tz_minutes_offset | Minutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0. |
| xctx | of caller. |
Definition at line 197 of file afw_time.c.
| void afw_date_subtract_yearMonthDuration | ( | afw_date_t * | date, |
| const afw_yearMonthDuration_t * | yearMonthDuration, | ||
| afw_xctx_t * | xctx | ||
| ) |
Subtract yearMonthDuration from date.
| date | pointer. |
| yearMonthDuration | to subtract from date. |
| xctx | of caller. |
Definition at line 1821 of file afw_time.c.
| void afw_date_utf8_set_internal | ( | const afw_utf8_t * | utf8, |
| afw_date_t * | internal, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert utf8 xml schema date to internal and set.
| utf8 | is xml schema compliant date. |
| internal | is place to return internal representation. |
| xctx | of caller. |
Definition at line 1061 of file afw_time.c.
| void afw_dateTime_add_dayTimeDuration | ( | afw_dateTime_t * | dateTime, |
| const afw_dayTimeDuration_t * | dayTimeDuration, | ||
| afw_xctx_t * | xctx | ||
| ) |
Add dayTimeDuration to dateTime.
| dateTime | pointer. |
| dayTimeDuration | to add to dateTime. |
| xctx | of caller. |
Definition at line 1851 of file afw_time.c.
| void afw_dateTime_add_yearMonthDuration | ( | afw_dateTime_t * | dateTime, |
| const afw_yearMonthDuration_t * | yearMonthDuration, | ||
| afw_xctx_t * | xctx | ||
| ) |
Add yearMonthDuration to dateTime.
| dateTime | pointer. |
| yearMonthDuration | to add to dateTime. |
| xctx | of caller. |
Definition at line 1979 of file afw_time.c.
| int afw_dateTime_compare | ( | const afw_dateTime_t * | v1, |
| const afw_dateTime_t * | v2, | ||
| afw_xctx_t * | xctx | ||
| ) |
compare two dateTime values.
| v1 | is first value |
| v2 | is second value |
The time zones of both v1 and v2 must match or an error is thrown.
Definition at line 1540 of file afw_time.c.
| const afw_dateTime_t* afw_dateTime_create_from_apr_time | ( | apr_time_t | apr_time, |
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Create afw_dateTime_t from apr time.
| apr_time | |
| p | to use for result. |
| xctx | of caller. |
Definition at line 324 of file afw_time.c.
| const afw_dateTime_t* afw_dateTime_create_from_parts | ( | int | year, |
| int | month, | ||
| int | day, | ||
| int | hour, | ||
| int | minute, | ||
| int | second, | ||
| int | microsecond, | ||
| int | tz_hours_offset, | ||
| int | tz_minutes_offset, | ||
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Create afw_dateTime_t from parts in specific pool.
| dateTime | is pointer to preallocated afw_dateTime_t. |
| year | including century. Negative is BC. No 0. |
| month | (1-12). |
| day | of month (1-31). Month limited to days in month.. |
| hour | (0-24). If hour is 24 then other values must be 0. |
| minute | (0-59). |
| second | (0-60+). 60 or more is allowed for leap seconds. |
| microsecond | (0-999999). |
| tz_hours_offset | Hours (-14 - +14). If +14 or -14, minutes must be 0. |
| tz_minutes_offset | Minutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0. |
| p | to use for result. |
| xctx | of caller. |
Definition at line 274 of file afw_time.c.
| const afw_utf8_t* afw_dateTime_internal_to_utf8 | ( | const afw_dateTime_t * | dateTime, |
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert internal dateTime to utf8 xml schema dateTime in specified pool.
| p | pool to use for result. |
| xctx | of caller. |
Definition at line 1081 of file afw_time.c.
| const afw_dateTime_t* afw_dateTime_now_local | ( | const afw_pool_t * | p, |
| afw_xctx_t * | xctx | ||
| ) |
Get now local time as dateTime in specified pool.
| p | pool to use for result. |
| xctx | of caller. |
Definition at line 639 of file afw_time.c.
| const afw_dateTime_t* afw_dateTime_now_utc | ( | const afw_pool_t * | p, |
| afw_xctx_t * | xctx | ||
| ) |
Get now time as dateTime in specified pool.
| p | pool to use for result. |
| xctx | of caller. |
Definition at line 593 of file afw_time.c.
| void afw_dateTime_set_from_apr_time | ( | afw_dateTime_t * | dateTime, |
| apr_time_t | apr_time, | ||
| afw_xctx_t * | xctx | ||
| ) |
Set afw_dateTime_t from apr_time.
| dateTime | is pointer to preallocated afw_dateTime_t. |
| apr_time | |
| xctx | of caller. |
Definition at line 304 of file afw_time.c.
| void afw_dateTime_set_from_parts | ( | afw_dateTime_t * | dateTime, |
| int | year, | ||
| int | month, | ||
| int | day, | ||
| int | hour, | ||
| int | minute, | ||
| int | second, | ||
| int | microsecond, | ||
| int | tz_hours_offset, | ||
| int | tz_minutes_offset, | ||
| afw_xctx_t * | xctx | ||
| ) |
Set afw_dateTime_t from parts.
| dateTime | is pointer to preallocated afw_dateTime_t. |
| year | including century. Negative is BC. No 0. |
| month | (1-12). |
| day | of month (1-31). Month limited to days in month.. |
| hour | (0-24). If hour is 24 then other values must be 0. |
| minute | (0-59). |
| second | (0-60+). 60 or more is allowed for leap seconds. |
| microsecond | (0-999999). |
| tz_hours_offset | Hours (-14 - +14). If +14 or -14, minutes must be 0. |
| tz_minutes_offset | Minutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0. |
| xctx | of caller. |
Definition at line 244 of file afw_time.c.
| void afw_dateTime_set_now | ( | afw_dateTime_t * | dateTime_local, |
| afw_dateTime_t * | dateTime_utc, | ||
| afw_xctx_t * | xctx | ||
| ) |
Set local and/or utc dateTime to now.
| dateTime | local pointer to place to set or NULL. |
| dateTime | utc pointer to place to set or NULL. |
| xctx | of caller. |
Definition at line 523 of file afw_time.c.
| void afw_dateTime_subtract_dayTimeDuration | ( | afw_dateTime_t * | dateTime, |
| const afw_dayTimeDuration_t * | dayTimeDuration, | ||
| afw_xctx_t * | xctx | ||
| ) |
Subtract dayTimeDuration from dateTime.
| dateTime | pointer. |
| dayTimeDuration | to subtract from dateTime. |
| xctx | of caller. |
Definition at line 1915 of file afw_time.c.
| void afw_dateTime_subtract_yearMonthDuration | ( | afw_dateTime_t * | dateTime, |
| const afw_yearMonthDuration_t * | yearMonthDuration, | ||
| afw_xctx_t * | xctx | ||
| ) |
Subtract yearMonthDuration from dateTime.
| dateTime | pointer. |
| yearMonthDuration | to subtract from dateTime. |
| xctx | of caller. |
Definition at line 2009 of file afw_time.c.
| void afw_dateTime_utf8_set_internal | ( | const afw_utf8_t * | utf8, |
| afw_dateTime_t * | internal, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert utf8 xml schema dateTime to internal and set.
| utf8 | is xml schema compliant date. |
| internal | is place to return internal representation. |
| xctx | of caller. |
Definition at line 1099 of file afw_time.c.
| const afw_utf8_t* afw_dateType_internal_to_generalized_time | ( | const afw_dateTime_t * | dateTime, |
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert internal dateTime to generalized time (see X.208) in specified pool.
| p | pool to use for result. |
| xctx | of caller. |
Definition at line 2039 of file afw_time.c.
| int afw_dayTimeDuration_compare | ( | const afw_dayTimeDuration_t * | v1, |
| const afw_dayTimeDuration_t * | v2, | ||
| afw_xctx_t * | xctx | ||
| ) |
compare two dateTime values.
| v1 | is first value |
| v2 | is second value |
The time zones of both v1 and v2 must match or an error is thrown.
Definition at line 1751 of file afw_time.c.
| const afw_dayTimeDuration_t* afw_dayTimeDuration_create_from_parts | ( | afw_boolean_t | is_positive, |
| afw_int32_t | days, | ||
| afw_int32_t | hours, | ||
| afw_int32_t | minutes, | ||
| afw_int32_t | seconds, | ||
| afw_int32_t | microseconds, | ||
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Create afw_dayTimeDuration_t from parts in specific pool.
| is_positive | true if duration is positive or false if negative. |
| days | (must be positive). |
| hours | (must be positive). |
| minutes | (must be positive). |
| seconds | (must be positive). |
| microseconds | (must be positive). |
| p | to use for result. |
| xctx | of caller. |
Definition at line 404 of file afw_time.c.
| const afw_utf8_t* afw_dayTimeDuration_internal_to_utf8 | ( | const afw_dayTimeDuration_t * | dayTimeDuration, |
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert internal dayTimeDuration to utf8 xml schema dayTimeDuration in specified pool.
| p | pool to use for result. |
| xctx | of caller. |
Definition at line 1126 of file afw_time.c.
| void afw_dayTimeDuration_set_from_parts | ( | afw_dayTimeDuration_t * | dayTimeDuration, |
| afw_boolean_t | is_positive, | ||
| int | days, | ||
| int | hours, | ||
| int | minutes, | ||
| int | seconds, | ||
| int | microseconds, | ||
| afw_xctx_t * | xctx | ||
| ) |
Set afw_dayTimeDuration_t from parts.
| dayTimeDuration | is pointer to preallocated afw_dayTimeDuration_t. |
| is_positive | true if duration is positive or false if negative. |
| days | (must be between 0 and AFW_INT32_MAX). |
| hours | (must be between 0 and AFW_INT32_MAX). |
| minutes | (must be between 0 and AFW_INT32_MAX). |
| seconds | (must be between 0 and AFW_INT32_MAX). |
| microseconds | (must be between 0 and AFW_INT32_MAX). |
| xctx | of caller. |
Definition at line 340 of file afw_time.c.
| void afw_dayTimeDuration_utf8_set_internal | ( | const afw_utf8_t * | utf8, |
| afw_dayTimeDuration_t * | internal, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert utf8 xml schema dayTimeDuration to internal and set.
| utf8 | is xml schema compliant dayTimeDuration. |
| internal | is place to return internal representation. |
| xctx | of caller. |
Definition at line 1234 of file afw_time.c.
| int afw_time_compare | ( | const afw_time_t * | v1, |
| const afw_time_t * | v2, | ||
| afw_xctx_t * | xctx | ||
| ) |
compare two time values.
| v1 | is first value |
| v2 | is second value |
The time zones of both v1 and v2 must match or an error is thrown.
Definition at line 1590 of file afw_time.c.
| const afw_time_t* afw_time_create_from_parts | ( | int | hour, |
| int | minute, | ||
| int | second, | ||
| int | microsecond, | ||
| int | tz_hours_offset, | ||
| int | tz_minutes_offset, | ||
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Create afw_time_t from parts in specific pool.
| dateTime | is pointer to preallocated afw_time_t. |
| hour | (0-24). If hour is 24 then other values must be 0. |
| minute | (0-59). |
| second | (0-60+). 60 or more is allowed for leap seconds. |
| microsecond | (0-999999). |
| tz_hours_offset | Hours (-14 - +14). If +14 or -14, minutes must be 0. |
| tz_minutes_offset | Minutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0. |
| p | to use for result. |
| xctx | of caller. |
Definition at line 448 of file afw_time.c.
| const afw_utf8_t* afw_time_internal_to_utf8 | ( | const afw_time_t * | time, |
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert internal time to utf8 xml schema time in specified pool.
| p | pool to use for result. |
| xctx | of caller. |
Definition at line 1369 of file afw_time.c.
| const afw_time_t* afw_time_now_local | ( | const afw_pool_t * | p, |
| afw_xctx_t * | xctx | ||
| ) |
Get now local time as time only in specified pool.
| p | pool to use for result. |
| xctx | of caller. |
Definition at line 652 of file afw_time.c.
| const afw_time_t* afw_time_now_utc | ( | const afw_pool_t * | p, |
| afw_xctx_t * | xctx | ||
| ) |
Get now time as time only in specified pool.
| p | pool to use for result. |
| xctx | of caller. |
Definition at line 606 of file afw_time.c.
| void afw_time_set_from_parts | ( | afw_time_t * | time, |
| int | hour, | ||
| int | minute, | ||
| int | second, | ||
| int | microsecond, | ||
| int | tz_hours_offset, | ||
| int | tz_minutes_offset, | ||
| afw_xctx_t * | xctx | ||
| ) |
Set afw_time_t from parts.
| time | is pointer to preallocated afw_time_t. |
| hour | (0-24). If hour is 24 then other values must be 0. |
| minute | (0-59). |
| second | (0-60+). 60 or more is allowed for leap seconds. |
| microsecond | (0-999999). |
| tz_hours_offset | Hours (-14 - +14). If +14 or -14, minutes must be 0. |
| tz_minutes_offset | Minutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0. |
| xctx | of caller. |
Definition at line 425 of file afw_time.c.
| void afw_time_set_now | ( | afw_time_t * | time_local, |
| afw_time_t * | time_utc, | ||
| afw_xctx_t * | xctx | ||
| ) |
Set local and/or utc time to now.
| time | local pointer to place to set or NULL. |
| time | utc pointer to place to set or NULL. |
| xctx | of caller. |
Definition at line 558 of file afw_time.c.
| afw_integer_t afw_time_to_microseconds_utc | ( | const afw_time_t * | time, |
| afw_xctx_t * | xctx | ||
| ) |
Convert time normalize to utc to microseconds.
| time | to convert. |
| xctx | of caller. |
Definition at line 665 of file afw_time.c.
| void afw_time_utf8_set_internal | ( | const afw_utf8_t * | utf8, |
| afw_time_t * | internal, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert utf8 xml schema dateTime to internal and set.
| utf8 | is xml schema compliant date. |
| internal | is place to return internal representation. |
| xctx | of caller. |
Definition at line 1385 of file afw_time.c.
| int afw_yearMonthDuration_compare | ( | const afw_yearMonthDuration_t * | v1, |
| const afw_yearMonthDuration_t * | v2, | ||
| afw_xctx_t * | xctx | ||
| ) |
compare two yearMonthDuration values.
| v1 | is first value |
| v2 | is second value |
Definition at line 1773 of file afw_time.c.
| const afw_yearMonthDuration_t* afw_yearMonthDuration_create_from_parts | ( | afw_boolean_t | is_positive, |
| afw_int32_t | years, | ||
| afw_int32_t | months, | ||
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Create afw_yearMonthDuration_t from parts in specific pool.
| is_positive | true if duration is positive or false if negative. |
| years | (must be between 0 and AFW_INT32_MAX). |
| months | (must be between 0 and AFW_INT32_MAX). |
| p | to use for result. |
| xctx | of caller. |
Definition at line 505 of file afw_time.c.
| const afw_utf8_t* afw_yearMonthDuration_internal_to_utf8 | ( | const afw_yearMonthDuration_t * | yearMonthDuration, |
| const afw_pool_t * | p, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert internal yearMonthDuration to utf8 xml schema yearMonthDuration in specified pool.
| p | pool to use for result. |
| xctx | of caller. |
Definition at line 1407 of file afw_time.c.
| void afw_yearMonthDuration_set_from_parts | ( | afw_yearMonthDuration_t * | yearMonthDuration, |
| afw_boolean_t | is_positive, | ||
| int | years, | ||
| int | months, | ||
| afw_xctx_t * | xctx | ||
| ) |
Set afw_yearMonthDuration_t from parts.
| yearMonthDuration | is pointer to preallocated afw_yearMonthDuration_t. |
| is_positive | true if duration is positive or false if negative. |
| years | (must be between 0 and AFW_INT32_MAX). |
| months | (must be between 0 and AFW_INT32_MAX). |
| xctx | of caller. |
Definition at line 471 of file afw_time.c.
| void afw_yearMonthDuration_utf8_set_internal | ( | const afw_utf8_t * | utf8, |
| afw_yearMonthDuration_t * | internal, | ||
| afw_xctx_t * | xctx | ||
| ) |
Convert utf8 xml schema yearMonthDuration to internal and set.
| utf8 | is xml schema compliant yearMonthDuration. |
| internal | is place to return internal representation. |
| xctx | of caller. |
Definition at line 1458 of file afw_time.c.