maxon::UniversalDateTime is a MAXON API ALIASES class used to create an object capable to represent Universal date-time (UTC+0000) in a convenient and effective form provided with numerous helpful methods to manage date & time representation.
It's highly recommended to use this class to store any date and time and conversion to maxon::LocalDateTime for a localized output should occur as late as possible to prevent time representation issues. The internal representation is an unsigned 64-bit length integer with the start time set at 01/01/1970-00:00 UTC+0000 and a time resolution of 1 second.
The Julian day variants have been introduced across the years to adapt to different reference epoch and return a proper Julian day representation of a given time/date. See Variants in Julian day;
// This example shows how to use the utilities found in the UniversalDateTime class
// allocate and initialize an UniversalDateTime at the current timestamp
maxon::UniversalDateTime::ToJulianDay(): given the Julian Date variant, year, month, day, hours, minutes and second returns the corresponding Julian day value.
// This example shows how to compute the Julian day given the required parameters
DiagnosticOutput(diagIDString + "On date @/@/@ and time @:@:@ , the Julian day computed using the @ variant is @.", day, month, year, hour, min, sec, varStr, julianDay);
A maxon::UniversalDateTime object can be read from and written to disk by serializing the data contained using the conventional functions.
// This example shows how to store and retrieve a UniversalDateTime from a file.