Arduino-RTC
Real-Time Clock (RTC) library for Arduino
usa_dst.h File Reference
#include <time.h>
#include <inttypes.h>
Include dependency graph for usa_dst.h:

Go to the source code of this file.

Macros

#define DST_START_MONTH   MARCH
 
#define DST_END_MONTH   NOVEMBER
 
#define DST_START_WEEK   2
 
#define DST_END_WEEK   1
 

Functions

int usa_dst (const time_t *timer, int32_t *z)
 

Macro Definition Documentation

#define DST_END_MONTH   NOVEMBER

Definition at line 61 of file usa_dst.h.

#define DST_END_WEEK   1

Definition at line 69 of file usa_dst.h.

#define DST_START_MONTH   MARCH

Daylight Saving function for the USA. To utilize this function, you must

1 #include <util/usa_dst.h>

and

1 set_dst(usa_dst);

Given the time stamp and time zone parameters provided, the Daylight Saving function must return a value appropriate for the tm structures' tm_isdst element. That is...

0: If Daylight Saving is not in effect. -1: If it cannot be determined if Daylight Saving is in effect.

A positive integer: Represents the number of seconds a clock is advanced for Daylight Saving. This will typically be ONE_HOUR.

Daylight Saving 'rules' are subject to frequent change. For production applications it is recommended to write your own DST function, which uses 'rules' obtained from, and modifiable by, the end user ( perhaps stored in EEPROM ).

Definition at line 57 of file usa_dst.h.

#define DST_START_WEEK   2

Definition at line 65 of file usa_dst.h.

Function Documentation

int usa_dst ( const time_t timer,
int32_t *  z 
)

Definition at line 72 of file usa_dst.h.