ORE Studio 0.0.4
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
time_utils Class Referencefinal

Cross-platform time utilities. More...

#include <time_utils.hpp>

Collaboration diagram for time_utils:
Collaboration graph

Static Public Member Functions

static std::tm * gmtime_safe (const std::time_t *time, std::tm *result)
 Converts time_t to UTC tm struct (cross-platform).
 
static std::tm * localtime_safe (const std::time_t *time, std::tm *result)
 Converts time_t to local tm struct (cross-platform).
 

Detailed Description

Cross-platform time utilities.

Member Function Documentation

◆ gmtime_safe()

std::tm * gmtime_safe ( const std::time_t *  time,
std::tm *  result 
)
static

Converts time_t to UTC tm struct (cross-platform).

This is a cross-platform wrapper around gmtime_r (POSIX) and gmtime_s (Windows).

Parameters
timeThe time_t value to convert.
resultPointer to tm struct to store the result.
Returns
Pointer to result on success, nullptr on failure.
Here is the caller graph for this function:

◆ localtime_safe()

std::tm * localtime_safe ( const std::time_t *  time,
std::tm *  result 
)
static

Converts time_t to local tm struct (cross-platform).

This is a cross-platform wrapper around localtime_r (POSIX) and localtime_s (Windows).

Parameters
timeThe time_t value to convert.
resultPointer to tm struct to store the result.
Returns
Pointer to result on success, nullptr on failure.
Here is the caller graph for this function: