Arduino-RTC
Real-Time Clock (RTC) library for Arduino
|
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
Classes | |
struct | tm |
Macros | |
#define | ONE_HOUR 3600 |
#define | ONE_DEGREE 3600 |
#define | ONE_DAY 86400UL |
#define | UNIX_OFFSET 946684800UL |
#define | NTP_OFFSET 3155673600UL |
Typedefs | |
typedef uint32_t | time_t |
Enumerations | |
enum | { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY } |
enum | { JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER } |
Functions | |
int32_t | difftime (time_t time1, time_t time0) |
time_t | mktime (struct tm *timeptr) |
time_t | mk_gmtime (const struct tm *timeptr) |
struct tm * | gmtime_r (const time_t *timer, struct tm *timeptr) |
struct tm * | localtime_r (const time_t *timer, struct tm *timeptr) |
char * | isotime_r (const struct tm *tmptr, char *buf) |
uint8_t | is_leap_year (int16_t year) |
void | set_dst (int(*)(const time_t *, int32_t *)) |
void | set_zone (int32_t) |
int32_t | get_zone () |
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 time.h.
#define NTP_OFFSET 3155673600UL |
#define ONE_DEGREE 3600 |
#define UNIX_OFFSET 946684800UL |
typedef uint32_t time_t |
anonymous enum |
anonymous enum |
The difftime function returns the difference between two binary time stamps, time1 - time0.
Definition at line 32 of file difftime.cpp.
int32_t get_zone | ( | ) |
Definition at line 40 of file set_zone.cpp.
The gmtime function converts the time stamp pointed to by timer into broken-down time, expressed as UTC.
Definition at line 33 of file gmtime_r.cpp.
uint8_t is_leap_year | ( | int16_t | year | ) |
Return 1 if year is a leap year, zero if it is not.
char* isotime_r | ( | const struct tm * | tmptr, |
char * | buf | ||
) |
The isotime function constructs an ascii string in the form
Definition at line 34 of file isotime_r.cpp.
The localtime function converts the time stamp pointed to by timer into broken-down time, expressed as Local time.
Definition at line 35 of file localtime_r.cpp.
This function 'compiles' the elements of a broken-down time structure, returning a binary time stamp. The elements of timeptr are interpreted as representing UTC.
The original values of the tm_wday and tm_yday elements of the structure are ignored, and the original values of the other elements are not restricted to the ranges stated for struct tm.
Unlike mktime(), this function DOES NOT modify the elements of timeptr.
Definition at line 32 of file mk_gmtime.cpp.
This function 'compiles' the elements of a broken-down time structure, returning a binary time stamp. The elements of timeptr are interpreted as representing Local Time. The original values of the tm_wday and tm_yday elements of the structure are ignored, and the original values of the other elements are not restricted to the ranges stated for struct tm.
On successful completion, the values of all elements of timeptr are set to the appropriate range.
Definition at line 35 of file mktime.cpp.
void set_dst | ( | int(*)(const time_t *, int32_t *) | ) |
Specify the Daylight Saving function. The Daylight Saving function should examine its parameters to determine whether Daylight Saving is in effect, and return a value appropriate for tm_isdst.
If a Daylight Saving function is not specified, the system will ignore Daylight Saving.
Definition at line 34 of file set_dst.cpp.
void set_zone | ( | int32_t | ) |
Set the 'time zone'. The parameter is given in seconds East of the Prime Meridian. Example for New York City:
If the time zone is not set, the time system will operate in UTC only.
Definition at line 34 of file set_zone.cpp.