DateTime

class mono::DateTime

A DateTime representation.

Public Functions

DateTime()

Construct an empty / invalid DateTime object.

DateTime(uint16_t years, uint8_t months, uint8_t days, uint8_t hours = 0, uint8_t minutes = 0, uint8_t seconds = 0)

Construct a DateTime object with a given date and time.

Parameters
  • years -

    The Year component of the date, for example 2016

  • months -

    The month component of the date from 1 to 12, May is 5

  • days -

    The day component of the date, 1-indexed, from 1 to 31

  • hours -

    Optional: The hour component of the timestamp, range is 0 to 23

  • minutes -

    The minute component of the timestamp, range is 0 to 59

  • seconds -

    The seconds component of the timestamp, range is 0 to 59

String ToString() const

Return the DateTime object as a huamn readable string.

Return
A mono string on the format: yyyy-MM-dd hh:mm:ss