Struct XmlDateTime#

Struct Documentation#

struct XmlDateTime#

This structure specifies the information in an XSD-DateTime field (cf. https://www.w3schools.com/XML/schema_dtypes_date.asp).

Public Functions

inline void Clear()#

Clears this object to its blank/initial state.

inline bool HasTimeZoneOffset() const#

Query if this object uses a “time zone offset”. This is the case of the fields offsetHours and offsetMinutes contain valid values and “isUTC” is false.

Returns:

True if a “time zone offset” is specified and it is used, false if not.

std::string ToXmlString() const#

Converts the information into a string conforming to the XSD-specification for the DateTime data type. If this object does not contain valid information, an exception of type illegal_argument is thrown.

Returns:

This object as a string.

std::wstring ToXmlWstring() const#

Converts the information into a string conforming to the XSD-specification for the DateTime data type. If this object does not contain valid information, an exception of type illegal_argument is thrown.

Returns:

This object as a string.

bool IsValid() const#

Query if this object contains valid information.

Returns:

True if valid, false if not.

Public Members

int sec#

Seconds after the minute - [0, 60] including leap second.

int min#

minutes after the hour - [0, 59]

int hour#

hours since midnight - [0, 23]

int mday#

day of the month - [1, 31]

int mon#

months since January - [0, 11]

int year#

year [-9999 - 9999]

bool isUTC#

True if this object is specifying the time-date in UTC.

int offsetHours#

The hours of the timezone-offset. If greater than 24 or less than -24, it indicates an invalid timezone-offset.

int offsetMinutes#

The minutes of the timezone-offset. If greater than 60 or negative, it indicates an invalid timezone-offset.

Public Static Functions

static bool TryParse(const char *sz, XmlDateTime *ptrDateTime)#

Attempts to parse an XmlDateTime from the given string. The string needs to conform to ISO8601.

Parameters:
  • sz – The string to parse.

  • ptrDateTime[inout] If non-null and the parsing was successful, the information will be put here.

Returns:

True if it succeeds, false if it fails.

static bool TryParse(const wchar_t *szw, XmlDateTime *ptrDateTime)#

Attempts to parse an XmlDateTime from the given string. The string needs to conform to ISO8601.

Parameters:
  • szw – The string to parse.

  • ptrDateTime[inout] If non-null and the parsing was successful, the information will be put here.

Returns:

True if it succeeds, false if it fails.