Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Files | Macros | Functions

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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_dateTime_now_utc (const afw_pool_t *p, afw_xctx_t *xctx)
 Get now time as dateTime in specified pool. More...
 
const afw_time_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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...
 

Detailed Description

Time support.

Macro Definition Documentation

◆ AFW_TIME_DAYS_TO_MICROSECONDS

#define AFW_TIME_DAYS_TO_MICROSECONDS (   DAYS)
Value:
AFW_TIME_HOURS_TO_MICROSECONDS( \
apr_int64_t afw_integer_t
typedef for big signed int.
Definition: afw_common.h:321

Definition at line 41 of file afw_time.h.

◆ AFW_TIME_HOURS_TO_MICROSECONDS

#define AFW_TIME_HOURS_TO_MICROSECONDS (   HOURS)
Value:
AFW_TIME_MINUTES_TO_MICROSECONDS( \
(afw_integer_t)(HOURS) * (afw_integer_t)60)

Definition at line 37 of file afw_time.h.

◆ AFW_TIME_MINUTES_TO_MICROSECONDS

#define AFW_TIME_MINUTES_TO_MICROSECONDS (   MINUTES)
Value:
AFW_TIME_SECONDS_TO_MICROSECONDS( \
(afw_integer_t)(MINUTES) * (afw_integer_t)60)

Definition at line 33 of file afw_time.h.

Function Documentation

◆ afw_dataType_generalized_time_set_internal()

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.

Parameters
generalized_time(see X.208).
internalis place to return internal representation.
xctxof caller.

Definition at line 2063 of file afw_time.c.

◆ afw_date_add_yearMonthDuration()

void afw_date_add_yearMonthDuration ( afw_date_t date,
const afw_yearMonthDuration_t yearMonthDuration,
afw_xctx_t xctx 
)

Add yearMonthDuration to date.

Parameters
datepointer.
yearMonthDurationto add to date.
xctxof caller.

Definition at line 1791 of file afw_time.c.

◆ afw_date_compare()

int afw_date_compare ( const afw_date_t v1,
const afw_date_t v2,
afw_xctx_t xctx 
)

compare two date values.

Parameters
v1is first value
v2is second value
Returns
int >0 if v1 larger, <0 if v2 larger, 0 if they are equal.

The time zones of both v1 and v2 must match or an error is thrown.

Definition at line 1517 of file afw_time.c.

◆ afw_date_create_from_parts()

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.

Parameters
dateis pointer to preallocated afw_date_t.
yearincluding century. Negative is BC. No 0.
month(1-12).
dayof month (1-31). Month limited to days in month..
tz_hours_offsetHours (-14 - +14). If +14 or -14, minutes must be 0.
tz_minutes_offsetMinutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0.
pto use for result.
xctxof caller.
Returns
afw_date_t struct.

Definition at line 219 of file afw_time.c.

◆ afw_date_internal_to_utf8()

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.

Parameters
ppool to use for result.
xctxof caller.
Returns
utf8 with converted value.

Definition at line 1045 of file afw_time.c.

◆ afw_date_maximum_days_in_month()

int afw_date_maximum_days_in_month ( afw_integer_t  year,
afw_integer_t  month 
)

Determine maximum days in a month.

Parameters
year
monthwhich can exceed 12.
Returns
maximum days in month.

Definition at line 1671 of file afw_time.c.

◆ afw_date_set_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.

Parameters
dateis pointer to preallocated afw_date_t.
yearincluding century. Negative is BC. No 0.
month(1-12).
dayof month (1-31). Month limited to days in month..
tz_hours_offsetHours (-14 - +14). If +14 or -14, minutes must be 0.
tz_minutes_offsetMinutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0.
xctxof caller.

Definition at line 197 of file afw_time.c.

◆ afw_date_subtract_yearMonthDuration()

void afw_date_subtract_yearMonthDuration ( afw_date_t date,
const afw_yearMonthDuration_t yearMonthDuration,
afw_xctx_t xctx 
)

Subtract yearMonthDuration from date.

Parameters
datepointer.
yearMonthDurationto subtract from date.
xctxof caller.

Definition at line 1821 of file afw_time.c.

◆ afw_date_utf8_set_internal()

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.

Parameters
utf8is xml schema compliant date.
internalis place to return internal representation.
xctxof caller.

Definition at line 1061 of file afw_time.c.

◆ afw_dateTime_add_dayTimeDuration()

void afw_dateTime_add_dayTimeDuration ( afw_dateTime_t dateTime,
const afw_dayTimeDuration_t dayTimeDuration,
afw_xctx_t xctx 
)

Add dayTimeDuration to dateTime.

Parameters
dateTimepointer.
dayTimeDurationto add to dateTime.
xctxof caller.

Definition at line 1851 of file afw_time.c.

◆ afw_dateTime_add_yearMonthDuration()

void afw_dateTime_add_yearMonthDuration ( afw_dateTime_t dateTime,
const afw_yearMonthDuration_t yearMonthDuration,
afw_xctx_t xctx 
)

Add yearMonthDuration to dateTime.

Parameters
dateTimepointer.
yearMonthDurationto add to dateTime.
xctxof caller.

Definition at line 1979 of file afw_time.c.

◆ afw_dateTime_compare()

int afw_dateTime_compare ( const afw_dateTime_t v1,
const afw_dateTime_t v2,
afw_xctx_t xctx 
)

compare two dateTime values.

Parameters
v1is first value
v2is second value
Returns
int >0 if v1 larger, <0 if v2 larger, 0 if they are equal.

The time zones of both v1 and v2 must match or an error is thrown.

Definition at line 1540 of file afw_time.c.

◆ afw_dateTime_create_from_apr_time()

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.

Parameters
apr_time
pto use for result.
xctxof caller.
Returns
afw_dateTime_t struct.

Definition at line 324 of file afw_time.c.

◆ afw_dateTime_create_from_parts()

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.

Parameters
dateTimeis pointer to preallocated afw_dateTime_t.
yearincluding century. Negative is BC. No 0.
month(1-12).
dayof 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_offsetHours (-14 - +14). If +14 or -14, minutes must be 0.
tz_minutes_offsetMinutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0.
pto use for result.
xctxof caller.
Returns
afw_dateTime_t struct.

Definition at line 274 of file afw_time.c.

◆ afw_dateTime_internal_to_utf8()

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.

Parameters
ppool to use for result.
xctxof caller.
Returns
utf8 with converted value.

Definition at line 1081 of file afw_time.c.

◆ afw_dateTime_now_local()

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.

Parameters
ppool to use for result.
xctxof caller.
Returns
date time

Definition at line 639 of file afw_time.c.

◆ afw_dateTime_now_utc()

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.

Parameters
ppool to use for result.
xctxof caller.
Returns
date time

Definition at line 593 of file afw_time.c.

◆ afw_dateTime_set_from_apr_time()

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.

Parameters
dateTimeis pointer to preallocated afw_dateTime_t.
apr_time
xctxof caller.

Definition at line 304 of file afw_time.c.

◆ afw_dateTime_set_from_parts()

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.

Parameters
dateTimeis pointer to preallocated afw_dateTime_t.
yearincluding century. Negative is BC. No 0.
month(1-12).
dayof 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_offsetHours (-14 - +14). If +14 or -14, minutes must be 0.
tz_minutes_offsetMinutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0.
xctxof caller.

Definition at line 244 of file afw_time.c.

◆ afw_dateTime_set_now()

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.

Parameters
dateTimelocal pointer to place to set or NULL.
dateTimeutc pointer to place to set or NULL.
xctxof caller.

Definition at line 523 of file afw_time.c.

◆ afw_dateTime_subtract_dayTimeDuration()

void afw_dateTime_subtract_dayTimeDuration ( afw_dateTime_t dateTime,
const afw_dayTimeDuration_t dayTimeDuration,
afw_xctx_t xctx 
)

Subtract dayTimeDuration from dateTime.

Parameters
dateTimepointer.
dayTimeDurationto subtract from dateTime.
xctxof caller.

Definition at line 1915 of file afw_time.c.

◆ afw_dateTime_subtract_yearMonthDuration()

void afw_dateTime_subtract_yearMonthDuration ( afw_dateTime_t dateTime,
const afw_yearMonthDuration_t yearMonthDuration,
afw_xctx_t xctx 
)

Subtract yearMonthDuration from dateTime.

Parameters
dateTimepointer.
yearMonthDurationto subtract from dateTime.
xctxof caller.

Definition at line 2009 of file afw_time.c.

◆ afw_dateTime_utf8_set_internal()

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.

Parameters
utf8is xml schema compliant date.
internalis place to return internal representation.
xctxof caller.

Definition at line 1099 of file afw_time.c.

◆ afw_dateType_internal_to_generalized_time()

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.

Parameters
ppool to use for result.
xctxof caller.
Returns
utf8 with converted value.

Definition at line 2039 of file afw_time.c.

◆ afw_dayTimeDuration_compare()

int afw_dayTimeDuration_compare ( const afw_dayTimeDuration_t v1,
const afw_dayTimeDuration_t v2,
afw_xctx_t xctx 
)

compare two dateTime values.

Parameters
v1is first value
v2is second value
Returns
int >0 if v1 larger, <0 if v2 larger, 0 if they are equal.

The time zones of both v1 and v2 must match or an error is thrown.

Definition at line 1751 of file afw_time.c.

◆ afw_dayTimeDuration_create_from_parts()

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.

Parameters
is_positivetrue 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).
pto use for result.
xctxof caller.
Returns
afw_dayTimeDuration_t struct.

Definition at line 404 of file afw_time.c.

◆ afw_dayTimeDuration_internal_to_utf8()

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.

Parameters
ppool to use for result.
xctxof caller.
Returns
utf8 with converted value.

Definition at line 1126 of file afw_time.c.

◆ afw_dayTimeDuration_set_from_parts()

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.

Parameters
dayTimeDurationis pointer to preallocated afw_dayTimeDuration_t.
is_positivetrue 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).
xctxof caller.

Definition at line 340 of file afw_time.c.

◆ afw_dayTimeDuration_utf8_set_internal()

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.

Parameters
utf8is xml schema compliant dayTimeDuration.
internalis place to return internal representation.
xctxof caller.

Definition at line 1234 of file afw_time.c.

◆ afw_time_compare()

int afw_time_compare ( const afw_time_t v1,
const afw_time_t v2,
afw_xctx_t xctx 
)

compare two time values.

Parameters
v1is first value
v2is second value
Returns
int >0 if v1 larger, <0 if v2 larger, 0 if they are equal.

The time zones of both v1 and v2 must match or an error is thrown.

Definition at line 1590 of file afw_time.c.

◆ afw_time_create_from_parts()

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.

Parameters
dateTimeis 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_offsetHours (-14 - +14). If +14 or -14, minutes must be 0.
tz_minutes_offsetMinutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0.
pto use for result.
xctxof caller.
Returns
afw_time_t struct.

Definition at line 448 of file afw_time.c.

◆ afw_time_internal_to_utf8()

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.

Parameters
ppool to use for result.
xctxof caller.
Returns
utf8 with converted value.

Definition at line 1369 of file afw_time.c.

◆ afw_time_now_local()

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.

Parameters
ppool to use for result.
xctxof caller.
Returns
time

Definition at line 652 of file afw_time.c.

◆ afw_time_now_utc()

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.

Parameters
ppool to use for result.
xctxof caller.
Returns
time

Definition at line 606 of file afw_time.c.

◆ afw_time_set_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.

Parameters
timeis 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_offsetHours (-14 - +14). If +14 or -14, minutes must be 0.
tz_minutes_offsetMinutes (0 - 59 or -1). -1 indicates no time zone, in which case, hours must be 0.
xctxof caller.

Definition at line 425 of file afw_time.c.

◆ afw_time_set_now()

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.

Parameters
timelocal pointer to place to set or NULL.
timeutc pointer to place to set or NULL.
xctxof caller.

Definition at line 558 of file afw_time.c.

◆ afw_time_to_microseconds_utc()

afw_integer_t afw_time_to_microseconds_utc ( const afw_time_t time,
afw_xctx_t xctx 
)

Convert time normalize to utc to microseconds.

Parameters
timeto convert.
xctxof caller.
Returns
time in microseconds

Definition at line 665 of file afw_time.c.

◆ afw_time_utf8_set_internal()

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.

Parameters
utf8is xml schema compliant date.
internalis place to return internal representation.
xctxof caller.

Definition at line 1385 of file afw_time.c.

◆ afw_yearMonthDuration_compare()

int afw_yearMonthDuration_compare ( const afw_yearMonthDuration_t v1,
const afw_yearMonthDuration_t v2,
afw_xctx_t xctx 
)

compare two yearMonthDuration values.

Parameters
v1is first value
v2is second value
Returns
int >0 if v1 larger, <0 if v2 larger, 0 if they are equal.

Definition at line 1773 of file afw_time.c.

◆ afw_yearMonthDuration_create_from_parts()

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.

Parameters
is_positivetrue 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).
pto use for result.
xctxof caller.
Returns
afw_yearMonthDuration_t struct.

Definition at line 505 of file afw_time.c.

◆ afw_yearMonthDuration_internal_to_utf8()

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.

Parameters
ppool to use for result.
xctxof caller.
Returns
utf8 with converted value.

Definition at line 1407 of file afw_time.c.

◆ afw_yearMonthDuration_set_from_parts()

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.

Parameters
yearMonthDurationis pointer to preallocated afw_yearMonthDuration_t.
is_positivetrue 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).
xctxof caller.

Definition at line 471 of file afw_time.c.

◆ afw_yearMonthDuration_utf8_set_internal()

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.

Parameters
utf8is xml schema compliant yearMonthDuration.
internalis place to return internal representation.
xctxof caller.

Definition at line 1458 of file afw_time.c.