The MAXON API provides the developer with two practical global functions to convert maxon::LocalDateTime to ANSI tm struct and vice versa.
Provided functions are:
From LocalDateTime to ANSI tm:
Definition: datetime.h:91
static Result< LocalDateTime > FromValues(Int32 year, UChar month, UChar day, UChar hour, UChar minute, UChar second, DST daylightSavingTime=DST::AUTOMATIC)
maxon::Int32 Int32
Definition: ge_sys_math.h:60
MAXON_ATTRIBUTE_FORCE_INLINE tm ConvertLocalDateTimeToTM(const LocalDateTime &dateTime)
Definition: ansi_type_conversions.h:17
struct tm * tm
Definition: pytime.h:218
#define iferr_return
Definition: resultbase.h:1465
From ANSI tm to maxon::LocalDateTime:
tmvalue.tm_year = 2016;
tmvalue.tm_mon = 7;
tmvalue.tm_mday = 1;
tmvalue.tm_hour = 9;
tmvalue.tm_min = 0;
tmvalue.tm_sec = 0;
MAXON_ATTRIBUTE_FORCE_INLINE LocalDateTime ConvertTMToLocalDateTime(const tm &st)
Definition: ansi_type_conversions.h:39