Skip to content

Class DateTime

ClassList > DateTime

Helper class to conveniently handle date and time.

  • #include <DS3231M.h>

Public Functions

Type Name
DateTime (uint16_t y=0, uint8_t m=0, uint8_t d=0, uint8_t hh=0, uint8_t mm=0, uint8_t ss=0)
Constructor of the DateTime class.
uint8_t day () const
Gets the day of the month.
uint8_t dayOfTheWeek () const
Calculates the day of the week.
uint8_t hour () const
Gets the hour.
uint8_t minute () const
Gets the minute.
uint8_t month () const
Gets the month.
uint8_t second () const
Gets the second.
uint16_t year () const
Gets the year.

Protected Attributes

Type Name
uint8_t d
Day of the month.
uint8_t hh
Hours.
uint8_t m
Month.
uint8_t mm
Minutes.
uint8_t ss
Seconds.
uint16_t y
Year.

Public Functions Documentation

function DateTime

Constructor of the DateTime class.

inline DateTime::DateTime (
    uint16_t y=0,
    uint8_t m=0,
    uint8_t d=0,
    uint8_t hh=0,
    uint8_t mm=0,
    uint8_t ss=0
) 

Parameters:

  • y Year
  • m Month
  • d Day
  • hh Hours
  • mm Minutes
  • ss Seconds

function day

Gets the day of the month.

inline uint8_t DateTime::day () const

Returns:

Day of the month.


function dayOfTheWeek

Calculates the day of the week.

uint8_t DateTime::dayOfTheWeek () const

Returns:

Day of the week (1 = Sunday, 2 = Monday, ..., 7 = Saturday).


function hour

Gets the hour.

inline uint8_t DateTime::hour () const

Returns:

Hour.


function minute

Gets the minute.

inline uint8_t DateTime::minute () const

Returns:

Minute.


function month

Gets the month.

inline uint8_t DateTime::month () const

Returns:

Month.


function second

Gets the second.

inline uint8_t DateTime::second () const

Returns:

Second.


function year

Gets the year.

inline uint16_t DateTime::year () const

Returns:

Year.


Protected Attributes Documentation

variable d

Day of the month.

uint8_t DateTime::d;


variable hh

Hours.

uint8_t DateTime::hh;


variable m

Month.

uint8_t DateTime::m;


variable mm

Minutes.

uint8_t DateTime::mm;


variable ss

Seconds.

uint8_t DateTime::ss;


variable y

Year.

uint16_t DateTime::y;



The documentation for this class was generated from the following file firmware/DS3231M.h