time_util.h File Reference

Time utility module header file. More...

#include "string_type.h"
Include dependency graph for time_util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

E_MCL_ERROR_CODE time_util_convert_to_iso_8601_format (const time_t *time_value, string_t **iso8601_formatted_time)
 
void time_util_get_time (mcl_time_t *current_time)
 
mcl_bool_t time_util_validate_timestamp (const char *timestamp)
 

Detailed Description

Time utility module header file.


Date
Dec 21, 2016 This utility module implements the time utility functions.

Definition in file time_util.h.

Function Documentation

E_MCL_ERROR_CODE time_util_convert_to_iso_8601_format ( const time_t *  time_value,
string_t **  iso8601_formatted_time 
)

This function converts time value to ISO 8601 date and time format.

Parameters
[in]time_valueNumber of seconds passed since reference time.
[out]iso8601_formatted_timeTime representation in ISO 8601 format.
Returns

Definition at line 19 of file time_util.c.

References ASSERT_CODE, ASSERT_STATEMENT_CODE_MESSAGE, DEBUG_ENTRY, DEBUG_LEAVE, MCL_DEBUG, MCL_FAIL, MCL_FREE, MCL_NEW, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, string_destroy(), and string_initialize_new().

Referenced by file_initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

void time_util_get_time ( mcl_time_t current_time)

This function returns the time elapsed in terms of seconds since Jan 1, 1970 UTC until now.

Parameters
[in]current_timeTime value in seconds.

Definition at line 61 of file time_util.c.

References DEBUG_ENTRY, and DEBUG_LEAVE.

Referenced by _create_self_issued_jwt_payload().

Here is the caller graph for this function:

mcl_bool_t time_util_validate_timestamp ( const char *  timestamp)

This function validates timestamp in terms of format, length and time value.

Parameters
[in]timestampTimestamp value to be checked against YYYY-MM-DDThh:mm:ss.sssZ format. Ex:2016-04-26T08:06:25.317Z
Returns
  • MCL_TRUE in case timestamp is valid.
  • MCL_FALSE in case timestamp is not valid in terms of format, length or time value.

Definition at line 71 of file time_util.c.

References DEBUG_ENTRY, DEBUG_LEAVE, MCL_NULL, string_util_strlen(), and string_util_strtol().

Referenced by mcl_store_new_event(), and mcl_time_series_new_value_set().

Here is the call graph for this function:

Here is the caller graph for this function: