16 #define GMTIME_R_EXISTS ((defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE>= 1) || defined(_XOPEN_SOURCE) || \ 17 defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || defined(_POSIX_SOURCE)) 19 #define TIMESTAMP_FIELD_COUNT 7 20 #define TIMESTAMP_DATE_INDEX 2 26 #if defined(WIN32) || defined(WIN64) || GMTIME_R_EXISTS 27 struct tm time_structure;
30 #if defined(WIN32) || defined(WIN64) 36 MCL_DEBUG_ENTRY(
"const time_t *time_value = <%p>, char **iso8601_formatted_time = <%p>", time_value, iso8601_formatted_time);
39 #if defined(WIN32) || defined(WIN64) 40 result = gmtime_s(&time_structure, time_value);
44 temp = gmtime_r(time_value, &time_structure);
47 temp = gmtime(time_value);
58 #if defined(WIN32) || defined(WIN64) || GMTIME_R_EXISTS 59 if (0 == strftime(iso8601_formatted_time,
MCL_TIMESTAMP_LENGTH,
"%Y-%m-%dT%H:%M:%S.000Z", &time_structure))
61 MCL_DEBUG(
"File creation time can not be converted to ISO-8601 date and time format.");
67 MCL_DEBUG(
"File creation time can not be converted to ISO-8601 date and time format.");
81 const char *position = timestamp;
92 ok = expected_timestamp_length == actual_timestamp_length;
97 ok = (characters_to_check[index] == timestamp[character_indexes_to_check[index]]);
106 ok = (maximum_values[index] >= int_value);
113 ok = (int_value > 0);
117 ok = (int_value >= 0);
122 position = end_pointer + 1;
#define MCL_TIMESTAMP_LENGTH
long string_util_strtol(const char *source, int base, char **end_pointer)
Assert module header file.
#define TIMESTAMP_DATE_INDEX
#define MCL_DEBUG_ENTRY(...)
String utility module header file.
mcl_error_t mcl_time_util_convert_to_iso_8601_format(const time_t *time_value, char *iso8601_formatted_time)
Time utility module interface header file.
#define MCL_ASSERT_CODE_MESSAGE(condition, return_code,...)
#define TIMESTAMP_FIELD_COUNT
void time_util_get_time(mcl_time_t *current_time)
#define MCL_NULL_CHAR_SIZE
mcl_bool_t mcl_time_util_validate_timestamp(const char *timestamp)
#define MCL_DEBUG_LEAVE(...)
mcl_size_t string_util_strlen(const char *buffer)
Time utility module header file.
Memory module interface header file.