10 #define __AFW_TIME_H__
30 #define AFW_TIME_SECONDS_TO_MICROSECONDS(SECONDS) \
31 (afw_integer_t)(SECONDS) * (afw_integer_t)1000000
33 #define AFW_TIME_MINUTES_TO_MICROSECONDS(MINUTES) \
34 AFW_TIME_SECONDS_TO_MICROSECONDS( \
35 (afw_integer_t)(MINUTES) * (afw_integer_t)60)
37 #define AFW_TIME_HOURS_TO_MICROSECONDS(HOURS) \
38 AFW_TIME_MINUTES_TO_MICROSECONDS( \
39 (afw_integer_t)(HOURS) * (afw_integer_t)60)
41 #define AFW_TIME_DAYS_TO_MICROSECONDS(DAYS) \
42 AFW_TIME_HOURS_TO_MICROSECONDS( \
43 (afw_integer_t)(DAYS) * (afw_integer_t)24)
64 int tz_minutes_offset,
87 int tz_minutes_offset,
148 int tz_minutes_offset,
179 int tz_minutes_offset,
254 int tz_minutes_offset,
279 int tz_minutes_offset,
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
apr_int32_t afw_int32_t
32-bit signed integer.
apr_int64_t afw_integer_t
typedef for big signed int.
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.
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.
void afw_date_subtract_yearMonthDuration(afw_date_t *date, const afw_yearMonthDuration_t *yearMonthDuration, afw_xctx_t *xctx)
Subtract yearMonthDuration from date.
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.
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.
void afw_date_add_yearMonthDuration(afw_date_t *date, const afw_yearMonthDuration_t *yearMonthDuration, afw_xctx_t *xctx)
Add yearMonthDuration to date.
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.
int afw_yearMonthDuration_compare(const afw_yearMonthDuration_t *v1, const afw_yearMonthDuration_t *v2, afw_xctx_t *xctx)
compare two yearMonthDuration values.
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.
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.
int afw_dayTimeDuration_compare(const afw_dayTimeDuration_t *v1, const afw_dayTimeDuration_t *v2, afw_xctx_t *xctx)
compare two dateTime values.
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.
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.
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.
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.
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.
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.
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.
afw_integer_t afw_time_to_microseconds_utc(const afw_time_t *time, afw_xctx_t *xctx)
Convert time normalize to utc to microseconds.
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.
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.
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.
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.
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.
void afw_dateTime_subtract_yearMonthDuration(afw_dateTime_t *dateTime, const afw_yearMonthDuration_t *yearMonthDuration, afw_xctx_t *xctx)
Subtract yearMonthDuration from dateTime.
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.
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.
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.
int afw_date_compare(const afw_date_t *v1, const afw_date_t *v2, afw_xctx_t *xctx)
compare two date values.
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.
void afw_dateTime_subtract_dayTimeDuration(afw_dateTime_t *dateTime, const afw_dayTimeDuration_t *dayTimeDuration, afw_xctx_t *xctx)
Subtract dayTimeDuration from dateTime.
void afw_dateTime_add_yearMonthDuration(afw_dateTime_t *dateTime, const afw_yearMonthDuration_t *yearMonthDuration, afw_xctx_t *xctx)
Add yearMonthDuration to dateTime.
int afw_date_maximum_days_in_month(afw_integer_t year, afw_integer_t month)
Determine maximum days in a month.
int afw_dateTime_compare(const afw_dateTime_t *v1, const afw_dateTime_t *v2, afw_xctx_t *xctx)
compare two dateTime values.
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.
int afw_time_compare(const afw_time_t *v1, const afw_time_t *v2, afw_xctx_t *xctx)
compare two time values.
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.
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.
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.
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.
void afw_dateTime_add_dayTimeDuration(afw_dateTime_t *dateTime, const afw_dayTimeDuration_t *dayTimeDuration, afw_xctx_t *xctx)
Add dayTimeDuration to dateTime.
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.
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.
date, time, and time zone.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Interface afw_xctx public struct.