Skip to content
hofben edited this page Jan 20, 2021 · 10 revisions

(under construction)
RtcDateTime represents the time and date in one object. It is used to retrieve and set the time on the Rtc objects.

Constructors

RtcDateTime(uint32_t secondsFrom2000)

Construct the RtcDateTime from seconds.
secondsFrom2000 - the number of seconds since Jan 1, 2000. This is not EPOCH date time.

RtcDateTime(uint16_t year, uint8_t month, uint8_t dayOfMonth, uint8_t hour, uint8_t minute, uint8_t second)

Construct the RtcDateTime from individual values of the date and time.

RtcDateTime(const char* date, const char* time)

Construct the RtcDateTime from the compilation format of date and time

    RtcDateTime compileDateTime(__DATE__, __TIME__);

Properties

uint16_t Year() const

<return>, the four digit year

uint8_t Month() const

<return>, the month

uint8_t Day() const

<return>, the day

uint8_t Hour() const

<return>, the hour, in 24 hours format

uint8_t Minute() const

<return>, the minutes

uint8_t Second() const

<return>, the seconds

uint8_t DayOfWeek() const

<return>, the day of the week, where the day of the week starts on Sunday with a value of 0.

Operators

void operator += (uint32_t seconds)

This allows for seconds to added to the time.

    time += 60; // add a minute

Methods

uint32_t TotalSeconds() const

<return>, the total seconds since 1/1/2000. This is not EPOCH time.

uint64_t TotalSeconds64() const;

<return>, the total seconds since 1/1/2000. This is not EPOCH time.

uint32_t Epoch32Time() const

<return>, an EPOCH time value.

void InitWithEpoch32Time(uint32_t time)

time - a time value in 32 bit EPOCH time space.

uint64_t Epoch64Time() const

<return>, an EPOCH time value.

void InitWithEpoch64Time(uint64_t time)

time - a time value in 64 bit EPOCH time space.

Clone this wiki locally