EU1KY AA
tm Struct Reference

#include <rtc2.h>

Data Fields

int sec
 
int min
 
int hour
 
int mday
 
int mon
 
int year
 
int wday
 
bool am
 
int twelveHour
 

Detailed Description

Time structure

Both 24-hour and 12-hour time is stored, and is always updated when rtc_get_time is called.

When setting time and alarm, 24-hour mode is always used.

If you run your clock in 12-hour mode:

  • set time hour to store in twelveHour and set am to true or false.
  • call rtc_12h_translate (this will put the correct value in hour, so you don't have to calculate it yourself.
  • call rtc_set_alarm or rtc_set_clock

Note that rtc_set_clock_s, rtc_set_alarm_s, rtc_get_time_s, rtc_set_alarm_s always operate in 24-hour mode and translation has to be done manually (you can call rtc_24h_to_12h to perform the calculation)

Field Documentation

bool tm::am
int tm::hour
int tm::mday
int tm::min
int tm::mon
int tm::sec
int tm::twelveHour
int tm::wday
int tm::year

The documentation for this struct was generated from the following file: