#include <mama/config.h>
#include <mama/status.h>
#include <mama/types.h>
#include <mama/timezone.h>
#include "wombat/port.h"
#include <time.h>
Go to the source code of this file.
Macros | |
#define | MAMA_DATE_TIME_HAS_DATE ((mamaDateTimeHints) 0x01) |
#define | MAMA_DATE_TIME_HAS_TIME ((mamaDateTimeHints) 0x02) |
#define | MAMA_DATE_TIME_NO_TIMEZONE ((mamaDateTimeHints) 0x04) |
Typedefs | |
typedef enum mamaDateTimePrecision_ | mamaDateTimePrecision |
typedef enum mamaDayOfWeek_ | mamaDayOfWeek |
typedef mama_u8_t | mamaDateTimeHints |
Enumerations | |
enum | mamaDateTimePrecision_ { MAMA_DATE_TIME_PREC_SECONDS = 0, MAMA_DATE_TIME_PREC_DECISECONDS = 1, MAMA_DATE_TIME_PREC_CENTISECONDS = 2, MAMA_DATE_TIME_PREC_MILLISECONDS = 3, MAMA_DATE_TIME_PREC_MICROSECONDS = 6, MAMA_DATE_TIME_PREC_DAYS = 10, MAMA_DATE_TIME_PREC_MINUTES = 12, MAMA_DATE_TIME_PREC_UNKNOWN = 15 } |
enum | mamaDayOfWeek_ { Sunday = 0, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday } |
Functions | |
MAMAExpDLL mama_status | mamaDateTime_create (mamaDateTime *dateTime) |
Create a date/time object. | |
MAMAExpDLL mama_status | mamaDateTime_destroy (mamaDateTime dateTime) |
Destroy a mamaDateTime object. | |
MAMAExpDLL mama_status | mamaDateTime_clear (mamaDateTime dateTime) |
Clear a mamaDateTime object. | |
MAMAExpDLL mama_status | mamaDateTime_clearDate (mamaDateTime dateTime) |
Clear the date part of a mamaDateTime object. | |
MAMAExpDLL mama_status | mamaDateTime_clearTime (mamaDateTime dateTime) |
Clear the time of day part of a mamaDateTime object (preserving the date). | |
MAMAExpDLL mama_status | mamaDateTime_copy (mamaDateTime dest, const mamaDateTime src) |
MAMAExpDLL int | mamaDateTime_empty (const mamaDateTime dateTime) |
MAMAExpDLL int | mamaDateTime_equal (const mamaDateTime lhs, const mamaDateTime rhs) |
MAMAExpDLL int | mamaDateTime_compare (const mamaDateTime lhs, const mamaDateTime rhs) |
MAMAExpDLL mama_status | mamaDateTime_setEpochTime (mamaDateTime dateTime, mama_u32_t seconds, mama_u32_t microseconds, mamaDateTimePrecision precision) |
Set the date and time as seconds and microseconds since the Epoch (UTC time zone) with an option to designate the accuracy of the time. | |
MAMAExpDLL mama_status | mamaDateTime_setEpochTimeF64 (mamaDateTime dateTime, mama_f64_t seconds) |
Set the date and time as seconds (plus, possibly fractional seconds) since the Epoch (UTC time zone). | |
MAMAExpDLL mama_status | mamaDateTime_setEpochTimeMilliseconds (mamaDateTime dateTime, mama_u64_t milliseconds) |
Set the date and time as milliseconds. | |
MAMAExpDLL mama_status | mamaDateTime_setEpochTimeMicroseconds (mamaDateTime dateTime, mama_u64_t milliseconds) |
Set the date and time as microseconds. | |
MAMAExpDLL mama_status | mamaDateTime_setWithHints (mamaDateTime dateTime, mama_u32_t seconds, mama_u32_t microseconds, mamaDateTimePrecision precision, mamaDateTimeHints hints) |
Set the date and/or time with special, optional hints to indicate whether the date/time includes date information, time information and/or whether a user of the date/time should consider it in the context of a time zone. | |
MAMAExpDLL mama_status | mamaDateTime_setPrecision (mamaDateTime dateTime, mamaDateTimePrecision precision) |
Set the precision hint. | |
MAMAExpDLL mama_status | mamaDateTime_setToNow (mamaDateTime dateTime) |
Set the date and time to the current UTC time. | |
MAMAExpDLL mama_status | mamaDateTime_setToMidnightToday (mamaDateTime dateTime, const mamaTimeZone tz) |
Set the dateTime object to 12am of the current date in the timezone provided (or UTC if NULL). | |
MAMAExpDLL mama_status | mamaDateTime_setWithPrecisionAndTz (mamaDateTime dateTime, mama_u32_t year, mama_u32_t month, mama_u32_t day, mama_u32_t hour, mama_u32_t minute, mama_u32_t second, mama_u32_t microsecond, mamaDateTimePrecision precision, const mamaTimeZone tz) |
Set the entire date and time for the MamaDateTime. | |
MAMAExpDLL mama_status | mamaDateTime_setTime (mamaDateTime dateTime, mama_u32_t hour, mama_u32_t minute, mama_u32_t second, mama_u32_t microsecond) |
Set the time-of-day portion of the MamaDateTime. | |
MAMAExpDLL mama_status | mamaDateTime_setTimeWithPrecisionAndTz (mamaDateTime dateTime, mama_u32_t hour, mama_u32_t minute, mama_u32_t second, mama_u32_t microsecond, mamaDateTimePrecision precision, const mamaTimeZone tz) |
Set the time-of-day portion of the MamaDateTime with explicit precision. | |
MAMAExpDLL mama_status | mamaDateTime_setDate (mamaDateTime dateTime, mama_u32_t year, mama_u32_t month, mama_u32_t day) |
Set the date portion of the MamaDateTime. | |
MAMAExpDLL mama_status | mamaDateTime_copyTime (mamaDateTime dest, const mamaDateTime src) |
Copy the time-of-day portion of the mamaDateTime. | |
MAMAExpDLL mama_status | mamaDateTime_copyDate (mamaDateTime dest, const mamaDateTime src) |
Copy the date portion of the mamaDateTime. | |
MAMAExpDLL mama_status | mamaDateTime_hasTime (const mamaDateTime dateTime, mama_bool_t *result) |
Determine whether the time-of-day portion of the MamaDateTime is set. | |
MAMAExpDLL mama_status | mamaDateTime_hasDate (const mamaDateTime dateTime, mama_bool_t *result) |
Determine whether the date portion of the MamaDateTime is set. | |
MAMAExpDLL mama_status | mamaDateTime_addSeconds (mamaDateTime dateTime, mama_f64_t seconds) |
Add a number of seconds, including fractional seconds (may be negative). | |
MAMAExpDLL mama_status | mamaDateTime_addWholeSeconds (mamaDateTime dateTime, mama_i32_t seconds) |
Add a number of whole seconds (may be negative). | |
MAMAExpDLL mama_status | mamaDateTime_addMicroseconds (mamaDateTime dateTime, mama_i64_t microseconds) |
Add a number of microseconds (may be negative) Add a number of microseconds (may be negative and greater than 1000000 or less than -1000000). | |
MAMAExpDLL mama_status | mamaDateTime_setFromString (mamaDateTime dateTime, const char *str) |
Set the date and time from a string representation of format YYYY-mm-dd HH:MM:SS.mmmmmm. | |
MAMAExpDLL mama_status | mamaDateTime_setFromStringWithTz (mamaDateTime dateTime, const char *str, const mamaTimeZone tz) |
Set the date and time from a string representation of format YYYY-mm-dd HH:MM:SS.mmmmmm. | |
MAMAExpDLL mama_status | mamaDateTime_setFromStringBuffer (mamaDateTime dateTime, const char *str, mama_size_t strLen) |
Set the date and time from an unterminated string representation of format YYYY-mm-dd HH:MM:SS.mmmmmm. | |
MAMAExpDLL mama_status | mamaDateTime_setFromStringBufferWithTz (mamaDateTime dateTime, const char *str, mama_size_t strLen, const mamaTimeZone tz) |
Set the date and time from an unterminated string representation of format YYYY-mm-dd HH:MM:SS.mmmmmm. | |
MAMAExpDLL mama_status | mamaDateTime_getEpochTime (const mamaDateTime dateTime, mama_u32_t *seconds, mama_u32_t *microseconds, mamaDateTimePrecision *precision) |
Get the date and time as seconds and microseconds since the Epoch (UTC time zone). | |
MAMAExpDLL mama_status | mamaDateTime_getEpochTimeWithTz (const mamaDateTime dateTime, mama_u32_t *seconds, mama_u32_t *microseconds, mamaDateTimePrecision *precision, const mamaTimeZone tz) |
Get the date and time as seconds and microseconds since the Epoch in the timezone supplied. | |
MAMAExpDLL mama_status | mamaDateTime_getEpochTimeMicroseconds (const mamaDateTime dateTime, mama_u64_t *microseconds) |
Get the date and time as microseconds since the Epoch, (using the UTC timezone). | |
MAMAExpDLL mama_status | mamaDateTime_getEpochTimeMicrosecondsWithTz (const mamaDateTime dateTime, mama_u64_t *microseconds, const mamaTimeZone tz) |
Get the date and time as microseconds since the Epoch in the supplied time zone. | |
MAMAExpDLL mama_status | mamaDateTime_getEpochTimeMilliseconds (const mamaDateTime dateTime, mama_u64_t *milliseconds) |
Get the date and time as milliseconds since the Epoch (UTC time zone). | |
MAMAExpDLL mama_status | mamaDateTime_getEpochTimeMillisecondsWithTz (const mamaDateTime dateTime, mama_u64_t *milliseconds, const mamaTimeZone tz) |
Get the date and time as milliseconds since the Epoch in the timezone supplied. | |
MAMAExpDLL mama_status | mamaDateTime_getEpochTimeSeconds (const mamaDateTime dateTime, mama_f64_t *seconds) |
Get the date and time as seconds since the Epoch (UTC time zone). | |
MAMAExpDLL mama_status | mamaDateTime_getEpochTimeSecondsWithCheck (const mamaDateTime dateTime, mama_f64_t *seconds) |
Get the date and time as seconds since the Epoch, (using the UTC timezone). | |
MAMAExpDLL mama_status | mamaDateTime_getEpochTimeSecondsWithTz (const mamaDateTime dateTime, mama_f64_t *seconds, const mamaTimeZone tz) |
Get the date and time as seconds since the Epoch in the timezone supplied. | |
MAMAExpDLL mama_status | mamaDateTime_getWithHints (const mamaDateTime dateTime, mama_u32_t *seconds, mama_u32_t *microseconds, mamaDateTimePrecision *precision, mama_u8_t *hints) |
Get the date and/or time with special, optional hints to indicate whether the date/time includes date information, time information and/or whether a user of the date/time should consider it in the context of a time zone. | |
MAMAExpDLL mama_status | mamaDateTime_getStructTimeVal (const mamaDateTime dateTime, struct timeval *result) |
Get the date/time as a "struct timeval". | |
MAMAExpDLL mama_status | mamaDateTime_getStructTimeValWithTz (const mamaDateTime dateTime, struct timeval *result, const mamaTimeZone tz) |
Get the date/time as a "struct timeval" in the timezone supplied. | |
MAMAExpDLL mama_status | mamaDateTime_getStructTm (const mamaDateTime dateTime, struct tm *result) |
Get the date/time as a "struct tm". | |
MAMAExpDLL mama_status | mamaDateTime_getStructTmWithTz (const mamaDateTime dateTime, struct tm *result, const mamaTimeZone tz) |
Get the date/time as a "struct tm" in the timezone supplied. | |
MAMAExpDLL mama_status | mamaDateTime_getAsString (const mamaDateTime dateTime, char *str, mama_size_t maxLen) |
Get the date and/or time as a string. | |
MAMAExpDLL mama_status | mamaDateTime_getTimeAsString (const mamaDateTime dateTime, char *str, mama_size_t maxLen) |
Get the time (no date) as a string. | |
MAMAExpDLL mama_status | mamaDateTime_getDateAsString (const mamaDateTime dateTime, char *str, mama_size_t maxLen) |
Get the date (no time) as a string. | |
MAMAExpDLL mama_status | mamaDateTime_getAsFormattedString (const mamaDateTime dateTime, char *str, mama_size_t maxLen, const char *format) |
Get the date and/or time as a string using the format provided. | |
MAMAExpDLL mama_status | mamaDateTime_getAsFormattedStringWithTz (const mamaDateTime dateTime, char *str, mama_size_t maxLen, const char *format, const mamaTimeZone tz) |
Get the date and/or time as a string using the format provided. | |
MAMAExpDLL mama_status | mamaDateTime_getYear (const mamaDateTime dateTime, mama_u32_t *result) |
Get the year (1970 onwards). | |
MAMAExpDLL mama_status | mamaDateTime_getMonth (const mamaDateTime dateTime, mama_u32_t *result) |
Get the month (1-12). | |
MAMAExpDLL mama_status | mamaDateTime_getDay (const mamaDateTime dateTime, mama_u32_t *result) |
Get the day of month (1-31). | |
MAMAExpDLL mama_status | mamaDateTime_getHour (const mamaDateTime dateTime, mama_u32_t *result) |
Get the hour (0-23). | |
MAMAExpDLL mama_status | mamaDateTime_getMinute (const mamaDateTime dateTime, mama_u32_t *result) |
Get the minute (0-59). | |
MAMAExpDLL mama_status | mamaDateTime_getSecond (const mamaDateTime dateTime, mama_u32_t *result) |
Get the second (0-59). | |
MAMAExpDLL mama_status | mamaDateTime_getMicrosecond (const mamaDateTime dateTime, mama_u32_t *result) |
Get the microsecond (0-999999). | |
MAMAExpDLL mama_status | mamaDateTime_getDayOfWeek (const mamaDateTime dateTime, mamaDayOfWeek *result) |
Get the day of week. | |
MAMAExpDLL mama_status | mamaDateTime_diffSeconds (const mamaDateTime t1, const mamaDateTime t0, mama_f64_t *result) |
Return the difference, in seconds (including fractions of seconds), between the two times. | |
MAMAExpDLL mama_status | mamaDateTime_diffSecondsSameDay (const mamaDateTime t1, const mamaDateTime t0, mama_f64_t *result) |
Return the difference, in seconds (including fractions of seconds), between the two times, ignoring any date information. | |
MAMAExpDLL mama_status | mamaDateTime_diffMicroseconds (const mamaDateTime t1, const mamaDateTime t0, mama_i64_t *result) |
Return the difference, in microseconds, between the two times. |
#define MAMA_DATE_TIME_HAS_DATE ((mamaDateTimeHints) 0x01) |
#define MAMA_DATE_TIME_HAS_TIME ((mamaDateTimeHints) 0x02) |
#define MAMA_DATE_TIME_NO_TIMEZONE ((mamaDateTimeHints) 0x04) |
typedef enum mamaDateTimePrecision_ mamaDateTimePrecision |
typedef enum mamaDayOfWeek_ mamaDayOfWeek |
typedef mama_u8_t mamaDateTimeHints |
enum mamaDayOfWeek_ |
MAMAExpDLL mama_status mamaDateTime_create | ( | mamaDateTime * | dateTime | ) |
Create a date/time object.
dateTime | The location of a mamaDateTime to store the result |
MAMAExpDLL mama_status mamaDateTime_destroy | ( | mamaDateTime | dateTime | ) |
Destroy a mamaDateTime object.
dateTime | The date/time object to destroy. |
MAMAExpDLL mama_status mamaDateTime_clear | ( | mamaDateTime | dateTime | ) |
Clear a mamaDateTime object.
dateTime | The date/time object to clear. |
MAMAExpDLL mama_status mamaDateTime_clearDate | ( | mamaDateTime | dateTime | ) |
Clear the date part of a mamaDateTime object.
dateTime | The date/time object to clear (preserving the time of day). |
MAMAExpDLL mama_status mamaDateTime_clearTime | ( | mamaDateTime | dateTime | ) |
Clear the time of day part of a mamaDateTime object (preserving the date).
dateTime | The date/time object to clear. |
MAMAExpDLL mama_status mamaDateTime_copy | ( | mamaDateTime | dest, |
const mamaDateTime | src | ||
) |
MAMAExpDLL int mamaDateTime_empty | ( | const mamaDateTime | dateTime | ) |
MAMAExpDLL int mamaDateTime_equal | ( | const mamaDateTime | lhs, |
const mamaDateTime | rhs | ||
) |
MAMAExpDLL int mamaDateTime_compare | ( | const mamaDateTime | lhs, |
const mamaDateTime | rhs | ||
) |
MAMAExpDLL mama_status mamaDateTime_setEpochTime | ( | mamaDateTime | dateTime, |
mama_u32_t | seconds, | ||
mama_u32_t | microseconds, | ||
mamaDateTimePrecision | precision | ||
) |
Set the date and time as seconds and microseconds since the Epoch (UTC time zone) with an option to designate the accuracy of the time.
dateTime | The dateTime to set. |
seconds | The number of seconds since the Epoch. |
microseconds | The number of microseconds. |
precision | The precision of the time stamp. |
MAMAExpDLL mama_status mamaDateTime_setEpochTimeF64 | ( | mamaDateTime | dateTime, |
mama_f64_t | seconds | ||
) |
Set the date and time as seconds (plus, possibly fractional seconds) since the Epoch (UTC time zone).
Fractional seconds will be rounded to microseconds.
dateTime | The dateTime to set. |
seconds | The number of seconds since the Epoch. |
MAMAExpDLL mama_status mamaDateTime_setEpochTimeMilliseconds | ( | mamaDateTime | dateTime, |
mama_u64_t | milliseconds | ||
) |
Set the date and time as milliseconds.
dateTime | The dateTime to set. |
milliseconds | The number of milliseconds since the Epoch. |
MAMAExpDLL mama_status mamaDateTime_setEpochTimeMicroseconds | ( | mamaDateTime | dateTime, |
mama_u64_t | milliseconds | ||
) |
Set the date and time as microseconds.
dateTime | The dateTime to set. |
milliseconds | The number of microseconds since the Epoch. |
MAMAExpDLL mama_status mamaDateTime_setWithHints | ( | mamaDateTime | dateTime, |
mama_u32_t | seconds, | ||
mama_u32_t | microseconds, | ||
mamaDateTimePrecision | precision, | ||
mamaDateTimeHints | hints | ||
) |
Set the date and/or time with special, optional hints to indicate whether the date/time includes date information, time information and/or whether a user of the date/time should consider it in the context of a time zone.
dateTime | The dateTime to set. |
seconds | The number of seconds (since the Epoch or start-of-day if no date). |
microseconds | The number of microseconds. |
precision | The precision of the date/time stamp. |
hints | Additional hints |
MAMAExpDLL mama_status mamaDateTime_setPrecision | ( | mamaDateTime | dateTime, |
mamaDateTimePrecision | precision | ||
) |
Set the precision hint.
dateTime | The dateTime to set. |
precision | The precision of the date/time stamp. |
MAMAExpDLL mama_status mamaDateTime_setToNow | ( | mamaDateTime | dateTime | ) |
Set the date and time to the current UTC time.
Precision and hints will be set appropriately.
dateTime | The dateTime to set. |
MAMAExpDLL mama_status mamaDateTime_setToMidnightToday | ( | mamaDateTime | dateTime, |
const mamaTimeZone | tz | ||
) |
Set the dateTime object to 12am of the current date in the timezone provided (or UTC if NULL).
dateTime | The dateTime to set. |
tz | The timezone in which the date will be set. |
MAMAExpDLL mama_status mamaDateTime_setWithPrecisionAndTz | ( | mamaDateTime | dateTime, |
mama_u32_t | year, | ||
mama_u32_t | month, | ||
mama_u32_t | day, | ||
mama_u32_t | hour, | ||
mama_u32_t | minute, | ||
mama_u32_t | second, | ||
mama_u32_t | microsecond, | ||
mamaDateTimePrecision | precision, | ||
const mamaTimeZone | tz | ||
) |
Set the entire date and time for the MamaDateTime.
The year, month and day parameters must all be integers greater than zero.
dateTime | The dateTime to set. |
year | The year (must be 1970 or later). |
month | The month (1 - 12). |
day | The day (1 - 31). |
hour | The hour (0 - 23). |
minute | The minute (0 - 59). |
second | The second (0 - 59). |
microsecond | The second (0 - 999999). |
precision | An explicit precision, if known. |
tz | A timezone to shift from. |
MAMAExpDLL mama_status mamaDateTime_setTime | ( | mamaDateTime | dateTime, |
mama_u32_t | hour, | ||
mama_u32_t | minute, | ||
mama_u32_t | second, | ||
mama_u32_t | microsecond | ||
) |
Set the time-of-day portion of the MamaDateTime.
The date portion is not affected.
dateTime | The dateTime to set. |
hour | The hour (0 - 23). |
minute | The minute (0 - 59). |
second | The second (0 - 59). |
microsecond | The microsecond (0 - 999999). |
MAMAExpDLL mama_status mamaDateTime_setTimeWithPrecisionAndTz | ( | mamaDateTime | dateTime, |
mama_u32_t | hour, | ||
mama_u32_t | minute, | ||
mama_u32_t | second, | ||
mama_u32_t | microsecond, | ||
mamaDateTimePrecision | precision, | ||
const mamaTimeZone | tz | ||
) |
Set the time-of-day portion of the MamaDateTime with explicit precision.
The date portion is not affected.
dateTime | The dateTime to set. |
hour | The hour (0 - 23). |
minute | The minute (0 - 59). |
second | The second (0 - 59). |
microsecond | The microsecond (0 - 999999). |
precision | An explicit precision, if known. |
tz | A timezone to shift from. |
MAMAExpDLL mama_status mamaDateTime_setDate | ( | mamaDateTime | dateTime, |
mama_u32_t | year, | ||
mama_u32_t | month, | ||
mama_u32_t | day | ||
) |
Set the date portion of the MamaDateTime.
The time-of-day portion is not affected.
dateTime | The dateTime to set. |
year | The year (must be 1970 or later). |
month | The month (1 - 12). |
day | The day (1 - 31). |
MAMAExpDLL mama_status mamaDateTime_copyTime | ( | mamaDateTime | dest, |
const mamaDateTime | src | ||
) |
Copy the time-of-day portion of the mamaDateTime.
The date portion is not affected.
dest | The dateTime to copy to. |
src | The dateTime to copy from. |
MAMAExpDLL mama_status mamaDateTime_copyDate | ( | mamaDateTime | dest, |
const mamaDateTime | src | ||
) |
Copy the date portion of the mamaDateTime.
The time-of-day portion is not affected.
dest | The dateTime to copy to. |
src | The dateTime to copy from. |
MAMAExpDLL mama_status mamaDateTime_hasTime | ( | const mamaDateTime | dateTime, |
mama_bool_t * | result | ||
) |
Determine whether the time-of-day portion of the MamaDateTime is set.
dateTime | The dateTime to check. |
result | Address of a bool to store the result. 0 false. |
MAMAExpDLL mama_status mamaDateTime_hasDate | ( | const mamaDateTime | dateTime, |
mama_bool_t * | result | ||
) |
Determine whether the date portion of the MamaDateTime is set.
dateTime | The dateTime to check. |
result | Address of mama_bool_t to store the result. 0 false. |
MAMAExpDLL mama_status mamaDateTime_addSeconds | ( | mamaDateTime | dateTime, |
mama_f64_t | seconds | ||
) |
Add a number of seconds, including fractional seconds (may be negative).
dateTime | The dateTime to set. |
seconds | The number of seconds to add (or subtract). |
MAMAExpDLL mama_status mamaDateTime_addWholeSeconds | ( | mamaDateTime | dateTime, |
mama_i32_t | seconds | ||
) |
Add a number of whole seconds (may be negative).
dateTime | The dateTime to set. |
seconds | The number of seconds to add (or subtract). |
MAMAExpDLL mama_status mamaDateTime_addMicroseconds | ( | mamaDateTime | dateTime, |
mama_i64_t | microseconds | ||
) |
Add a number of microseconds (may be negative) Add a number of microseconds (may be negative and greater than 1000000 or less than -1000000).
dateTime | The dateTime to set. |
microseconds | The number of microseconds to add. Can be positive or negative. Note that there are no restrictions on the magnitude of this value. |
MAMAExpDLL mama_status mamaDateTime_setFromString | ( | mamaDateTime | dateTime, |
const char * | str | ||
) |
Set the date and time from a string representation of format YYYY-mm-dd HH:MM:SS.mmmmmm.
(YYYY/mm/dd also works.) The precision of subseconds is determined by the number of digits after the decimal point.
dateTime | The dateTime to set. |
str | The string representation of some date and/or time. |
MAMAExpDLL mama_status mamaDateTime_setFromStringWithTz | ( | mamaDateTime | dateTime, |
const char * | str, | ||
const mamaTimeZone | tz | ||
) |
Set the date and time from a string representation of format YYYY-mm-dd HH:MM:SS.mmmmmm.
(YYYY/mm/dd also works.) The precision of subseconds is determined by the number of digits after the decimal point. If tz is not NULL, the time string is assumed to be set in a different time zone and will be adjusted to UTC accordingly.
dateTime | The dateTime to set. |
str | The string representation of some date and/or time. |
tz | A timezone to shift from. |
MAMAExpDLL mama_status mamaDateTime_setFromStringBuffer | ( | mamaDateTime | dateTime, |
const char * | str, | ||
mama_size_t | strLen | ||
) |
Set the date and time from an unterminated string representation of format YYYY-mm-dd HH:MM:SS.mmmmmm.
(YYYY/mm/dd also works.) The precision of subseconds is determined by the number of digits after the decimal point.
dateTime | The dateTime to set. |
str | The string representation of some date and/or time. |
strLen | The length of the unterminated string date/time. |
MAMAExpDLL mama_status mamaDateTime_setFromStringBufferWithTz | ( | mamaDateTime | dateTime, |
const char * | str, | ||
mama_size_t | strLen, | ||
const mamaTimeZone | tz | ||
) |
Set the date and time from an unterminated string representation of format YYYY-mm-dd HH:MM:SS.mmmmmm.
(YYYY/mm/dd also works.) The precision of subseconds is determined by the number of digits after the decimal point. If tz is not NULL, the time string is assumed to be set in a different time zone and will be adjusted to UTC accordingly.
dateTime | The dateTime to set. |
str | The string representation of some date and/or time. |
strLen | The length of the unterminated string date/time. |
tz | A timezone to shift from. |
MAMAExpDLL mama_status mamaDateTime_getEpochTime | ( | const mamaDateTime | dateTime, |
mama_u32_t * | seconds, | ||
mama_u32_t * | microseconds, | ||
mamaDateTimePrecision * | precision | ||
) |
Get the date and time as seconds and microseconds since the Epoch (UTC time zone).
dateTime | The dateTime to set. |
seconds | The number of seconds since the Epoch. |
microseconds | The number of additional microseconds. |
precision | The precision of the returned time value. |
MAMAExpDLL mama_status mamaDateTime_getEpochTimeWithTz | ( | const mamaDateTime | dateTime, |
mama_u32_t * | seconds, | ||
mama_u32_t * | microseconds, | ||
mamaDateTimePrecision * | precision, | ||
const mamaTimeZone | tz | ||
) |
Get the date and time as seconds and microseconds since the Epoch in the timezone supplied.
dateTime | The dateTime to set. |
seconds | The number of seconds since the Epoch. |
microseconds | The number of additional microseconds. |
precision | The precision of the returned time value. |
tz | The timezone for the returned values. |
MAMAExpDLL mama_status mamaDateTime_getEpochTimeMicroseconds | ( | const mamaDateTime | dateTime, |
mama_u64_t * | microseconds | ||
) |
Get the date and time as microseconds since the Epoch, (using the UTC timezone).
[in] | dateTime | The dateTime to obtain the number of microseconds from. |
[out] | microseconds | The number of microseconds since the Epoch. |
MAMAExpDLL mama_status mamaDateTime_getEpochTimeMicrosecondsWithTz | ( | const mamaDateTime | dateTime, |
mama_u64_t * | microseconds, | ||
const mamaTimeZone | tz | ||
) |
Get the date and time as microseconds since the Epoch in the supplied time zone.
[in] | dateTime | The dateTime to obtain the number of microseconds from. |
[out] | microseconds | The number of microseconds since the Epoch. |
int] | tz The timezone. |
MAMAExpDLL mama_status mamaDateTime_getEpochTimeMilliseconds | ( | const mamaDateTime | dateTime, |
mama_u64_t * | milliseconds | ||
) |
Get the date and time as milliseconds since the Epoch (UTC time zone).
dateTime | The dateTime to set. |
milliseconds | The number of milliseconds since the Epoch. |
MAMAExpDLL mama_status mamaDateTime_getEpochTimeMillisecondsWithTz | ( | const mamaDateTime | dateTime, |
mama_u64_t * | milliseconds, | ||
const mamaTimeZone | tz | ||
) |
Get the date and time as milliseconds since the Epoch in the timezone supplied.
dateTime | The dateTime to set. |
milliseconds | The number of milliseconds since the Epoch. |
tz | The timezone for the returned values. |
MAMAExpDLL mama_status mamaDateTime_getEpochTimeSeconds | ( | const mamaDateTime | dateTime, |
mama_f64_t * | seconds | ||
) |
Get the date and time as seconds since the Epoch (UTC time zone).
dateTime | The dateTime to set |
seconds | The number of seconds (including partial seconds) since the Epoch. |
MAMAExpDLL mama_status mamaDateTime_getEpochTimeSecondsWithCheck | ( | const mamaDateTime | dateTime, |
mama_f64_t * | seconds | ||
) |
Get the date and time as seconds since the Epoch, (using the UTC timezone).
If no date value is contained in the dateTime then it will be set to today's date and the calculation made.
[in] | dateTime | The dateTime to obtain the number of microseconds from. |
[out] | seconds | The number of seconds, (including partial seconds), since the Epoch. |
MAMAExpDLL mama_status mamaDateTime_getEpochTimeSecondsWithTz | ( | const mamaDateTime | dateTime, |
mama_f64_t * | seconds, | ||
const mamaTimeZone | tz | ||
) |
Get the date and time as seconds since the Epoch in the timezone supplied.
dateTime | The dateTime to set |
seconds | The number of seconds (including partial seconds) since the Epoch. |
tz | The timezone for the returned values. |
MAMAExpDLL mama_status mamaDateTime_getWithHints | ( | const mamaDateTime | dateTime, |
mama_u32_t * | seconds, | ||
mama_u32_t * | microseconds, | ||
mamaDateTimePrecision * | precision, | ||
mama_u8_t * | hints | ||
) |
Get the date and/or time with special, optional hints to indicate whether the date/time includes date information, time information and/or whether a user of the date/time should consider it in the context of a time zone.
dateTime | The dateTime to set. |
seconds | The number of seconds (since the Epoch or start-of-day if no date). |
microseconds | The number of microseconds. |
precision | The precision of the date/time stamp. |
hints | Additional hints |
MAMAExpDLL mama_status mamaDateTime_getStructTimeVal | ( | const mamaDateTime | dateTime, |
struct timeval * | result | ||
) |
Get the date/time as a "struct timeval".
dateTime | The dateTime to set. |
result | The struct timeval to fill in. |
MAMAExpDLL mama_status mamaDateTime_getStructTimeValWithTz | ( | const mamaDateTime | dateTime, |
struct timeval * | result, | ||
const mamaTimeZone | tz | ||
) |
Get the date/time as a "struct timeval" in the timezone supplied.
dateTime | The dateTime to set. |
result | The struct timeval to fill in. |
tz | The timezone for the returned values. |
MAMAExpDLL mama_status mamaDateTime_getStructTm | ( | const mamaDateTime | dateTime, |
struct tm * | result | ||
) |
Get the date/time as a "struct tm".
dateTime | The dateTime to set. |
result | The struct timeval to fill in. |
MAMAExpDLL mama_status mamaDateTime_getStructTmWithTz | ( | const mamaDateTime | dateTime, |
struct tm * | result, | ||
const mamaTimeZone | tz | ||
) |
Get the date/time as a "struct tm" in the timezone supplied.
dateTime | The dateTime to set. |
result | The struct timeval to fill in. |
tz | The timezone for the returned values. |
MAMAExpDLL mama_status mamaDateTime_getAsString | ( | const mamaDateTime | dateTime, |
char * | str, | ||
mama_size_t | maxLen | ||
) |
Get the date and/or time as a string.
If no date information is available, no date is printed in the resulting string. The format for dates is YYYY-mm-dd (the ISO 8601 date format) and the format for times is HH:MM:SS.mmmmmmm (where the precision of the subseconds may vary depending upon any precision hints available).
dateTime | The dateTime to set. |
str | The string buffer to update. |
maxLen | The maximum size of the string buffer (including trailing '\0'). |
MAMAExpDLL mama_status mamaDateTime_getTimeAsString | ( | const mamaDateTime | dateTime, |
char * | str, | ||
mama_size_t | maxLen | ||
) |
Get the time (no date) as a string.
The format for times is HH:MM:SS.mmmmmmm (where the precision of the subseconds may vary depending upon any precision hints available).
dateTime | The dateTime to set. |
str | The string buffer to update. |
maxLen | The maximum size of the string buffer (including trailing '\0'). |
MAMAExpDLL mama_status mamaDateTime_getDateAsString | ( | const mamaDateTime | dateTime, |
char * | str, | ||
mama_size_t | maxLen | ||
) |
Get the date (no time) as a string.
The format for dates is YYYY-mm-dd (the ISO 8601 date format).
dateTime | The dateTime to set. |
str | The string buffer to update. |
maxLen | The maximum size of the string buffer (including trailing '\0'). |
MAMAExpDLL mama_status mamaDateTime_getAsFormattedString | ( | const mamaDateTime | dateTime, |
char * | str, | ||
mama_size_t | maxLen, | ||
const char * | format | ||
) |
Get the date and/or time as a string using the format provided.
The format string can be the common ones supported by strftime() (Y, m, d, F, T, Y, H, M, S, B, b, h, ), with the additional format strings, "%:" and "%;", which represents the number of subseconds in millis. "%;" includes the dot and only prints the subseconds if they are non-zero. "%:" does not include the dot, and prints "000" for 0 milliseconds. "%." and "%," are identical to "%:" and "%;" except they use the internal precision field to determine how many decimal places to print.
dateTime | The dateTime to set. |
str | The string buffer to update. |
maxLen | The maximum size of the string buffer (including trailing '\0'). |
format | The output format. |
MAMAExpDLL mama_status mamaDateTime_getAsFormattedStringWithTz | ( | const mamaDateTime | dateTime, |
char * | str, | ||
mama_size_t | maxLen, | ||
const char * | format, | ||
const mamaTimeZone | tz | ||
) |
Get the date and/or time as a string using the format provided.
The format string can be the common ones supported by strftime() (Y, m, d, F, T, Y, H, M, S, B, b, h, ), with the additional format strings, "%:" and "%;", which represents the number of subseconds in millis. "%;" includes the dot and only prints the subseconds if they are non-zero. "%:" does not include the dot, and prints "000" for 0 milliseconds. "%." and "%," are identical to "%:" and "%;" except they use the internal precision field to determine how many decimal places to print.
dateTime | The dateTime to set. |
str | The string buffer to update. |
maxLen | The maximum size of the string buffer (including trailing '\0'). |
format | The output format. |
tz | The timezone for the returned date/time. |
MAMAExpDLL mama_status mamaDateTime_getYear | ( | const mamaDateTime | dateTime, |
mama_u32_t * | result | ||
) |
Get the year (1970 onwards).
dateTime | The dateTime from which to get the result. |
result | The result of the get method. |
MAMAExpDLL mama_status mamaDateTime_getMonth | ( | const mamaDateTime | dateTime, |
mama_u32_t * | result | ||
) |
Get the month (1-12).
dateTime | The dateTime from which to get the result. |
result | The result of the get method. |
MAMAExpDLL mama_status mamaDateTime_getDay | ( | const mamaDateTime | dateTime, |
mama_u32_t * | result | ||
) |
Get the day of month (1-31).
dateTime | The dateTime from which to get the result. |
result | The result of the get method. |
MAMAExpDLL mama_status mamaDateTime_getHour | ( | const mamaDateTime | dateTime, |
mama_u32_t * | result | ||
) |
Get the hour (0-23).
dateTime | The dateTime from which to get the result. |
result | The result of the get method. |
MAMAExpDLL mama_status mamaDateTime_getMinute | ( | const mamaDateTime | dateTime, |
mama_u32_t * | result | ||
) |
Get the minute (0-59).
dateTime | The dateTime from which to get the result. |
result | The result of the get method. |
MAMAExpDLL mama_status mamaDateTime_getSecond | ( | const mamaDateTime | dateTime, |
mama_u32_t * | result | ||
) |
Get the second (0-59).
dateTime | The dateTime from which to get the result. |
result | The result of the get method. |
MAMAExpDLL mama_status mamaDateTime_getMicrosecond | ( | const mamaDateTime | dateTime, |
mama_u32_t * | result | ||
) |
Get the microsecond (0-999999).
dateTime | The dateTime from which to get the result. |
result | The result of the get method. |
MAMAExpDLL mama_status mamaDateTime_getDayOfWeek | ( | const mamaDateTime | dateTime, |
mamaDayOfWeek * | result | ||
) |
Get the day of week.
dateTime | The dateTime from which to get the result. |
result | The result of the get method. |
MAMAExpDLL mama_status mamaDateTime_diffSeconds | ( | const mamaDateTime | t1, |
const mamaDateTime | t0, | ||
mama_f64_t * | result | ||
) |
Return the difference, in seconds (including fractions of seconds), between the two times.
MAMAExpDLL mama_status mamaDateTime_diffSecondsSameDay | ( | const mamaDateTime | t1, |
const mamaDateTime | t0, | ||
mama_f64_t * | result | ||
) |
Return the difference, in seconds (including fractions of seconds), between the two times, ignoring any date information.
MAMAExpDLL mama_status mamaDateTime_diffMicroseconds | ( | const mamaDateTime | t1, |
const mamaDateTime | t0, | ||
mama_i64_t * | result | ||
) |
Return the difference, in microseconds, between the two times.