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

Go to the source code of this file.

Classes

class  RTC
 

Macros

#define ONE_HOUR   3600
 
#define ONE_DEGREE   3600
 
#define ONE_DAY   86400UL
 
#define UNIX_OFFSET   946684800UL
 
#define NTP_OFFSET   3155673600UL
 
#define isotime_r(tm, buf)   (strftime (buf, 32, "%F %T", tm), buf)
 
#define set_zone(x)   _timezone = x
 
#define get_zone()   _timezone
 

Enumerations

enum  {
  SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
  THURSDAY, FRIDAY, SATURDAY
}
 
enum  {
  JANUARY, FEBRUARY, MARCH, APRIL,
  MAY, JUNE, JULY, AUGUST,
  SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER
}
 

Detailed Description

Version
1.0

License

Copyright (C) 2017, Mikael Patel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

Definition in file RTC.h.

Macro Definition Documentation

#define get_zone ( )    _timezone

Definition at line 79 of file RTC.h.

#define isotime_r (   tm,
  buf 
)    (strftime (buf, 32, "%F %T", tm), buf)

The isotime function constructs an ascii string in the form

1 YYYY-MM-DD hh:mm:ss

Definition at line 69 of file RTC.h.

#define NTP_OFFSET   3155673600UL

Difference between the Y2K and the NTP epochs, in seconds.

Definition at line 63 of file RTC.h.

#define ONE_DAY   86400UL

One day, expressed in seconds

Definition at line 57 of file RTC.h.

#define ONE_DEGREE   3600

Angular degree, expressed in arc seconds

Definition at line 54 of file RTC.h.

#define ONE_HOUR   3600

One hour, expressed in seconds

Definition at line 51 of file RTC.h.

#define set_zone (   x)    _timezone = x

Set the 'time zone'. The parameter is given in seconds East of the Prime Meridian. Example for New York City:

1  set_zone(-5 *
2 ONE_HOUR);

If the time zone is not set, the time system will operate in UTC only.

Definition at line 78 of file RTC.h.

#define UNIX_OFFSET   946684800UL

Difference between the Y2K and the UNIX epochs, in seconds.

Definition at line 60 of file RTC.h.

Enumeration Type Documentation

anonymous enum
Enumerator
SUNDAY 
MONDAY 
TUESDAY 
WEDNESDAY 
THURSDAY 
FRIDAY 
SATURDAY 

Definition at line 25 of file RTC.h.

anonymous enum
Enumerator
JANUARY 
FEBRUARY 
MARCH 
APRIL 
MAY 
JUNE 
JULY 
AUGUST 
SEPTEMBER 
OCTOBER 
NOVEMBER 
DECEMBER 

Definition at line 35 of file RTC.h.