Mstdlib-1.24.0
|
Functions | |
M_time_t | M_time_from_str (const char *timestr, const M_time_tz_t *tz, M_bool default_end_of_day) |
char * | M_time_to_str (const char *fmt, const M_time_localtm_t *tm) |
char * | M_time_parsefmt (const char *s, const char *fmt, M_time_localtm_t *tm) |
M_time_t M_time_from_str | ( | const char * | timestr, |
const M_time_tz_t * | tz, | ||
M_bool | default_end_of_day | ||
) |
Parse a time string.
Supports offsets and fixed formats.
Offsets:
Ex: +6 Months or -7 hours
Offsets use the current time.
Fixed:
[in] | timestr | The time string to parse. |
[in] | tz | The time zone to use. If NULL the local system time zone will be used. This will only be used if the parsed time does not include a fixed time zone offset. |
[in] | default_end_of_day | M_TRUE when the returned time be at the end of the day if a time is not explictly present in the string. |
char * M_time_to_str | ( | const char * | fmt, |
const M_time_localtm_t * | tm | ||
) |
Format a date and time as a string.
[in] | fmt | The format of the string. |
[in] | tm | The tm strcut to read from. |
Supports the following format options
char * M_time_parsefmt | ( | const char * | s, |
const char * | fmt, | ||
M_time_localtm_t * | tm | ||
) |
Parse a formatted time string into a tm structure.
Supports the following input descriptors:
Notes on format:
[in] | s | The string to parse. |
[in] | fmt | The format of the string. |
[out] | tm | The tm strcut to fill. |