AceTime  3.0.0
Date and time classes for Arduino that support timezones from the TZ Database.
ZonedExtra.cpp
1 #include "ZonedExtra.h"
2 #include "TimeZone.h"
3 
4 namespace ace_time {
5 
7  int16_t year, uint8_t month, uint8_t day,
8  uint8_t hour, uint8_t minute, uint8_t second,
9  const TimeZone& tz, uint8_t fold) {
11  year, month, day, hour, minute, second, fold);
12  return forLocalDateTime(ldt, tz);
13 }
14 
15 // These are defined in the .cpp file to break cyclic dependency.
17  acetime_t epochSeconds,
18  const TimeZone& tz) {
19  return tz.getZonedExtra(epochSeconds);
20 }
21 
22 // These are defined in the .cpp file to break cyclic dependency.
24  const LocalDateTime& ldt,
25  const TimeZone& tz) {
26  return tz.getZonedExtra(ldt);
27 }
28 
29 }
Class that holds the date-time as the components (year, month, day, hour, minute, second) without reg...
Definition: LocalDateTime.h:30
static LocalDateTime forComponents(int16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint8_t fold=0)
Factory method using separated date and time components.
Definition: LocalDateTime.h:44
Class that describes a time zone.
Definition: TimeZone.h:86
ZonedExtra getZonedExtra(const LocalDateTime &ldt) const
Return the ZonedExtra information at epochSeconds.
Definition: TimeZone.h:304
static ZonedExtra forLocalDateTime(const LocalDateTime &ldt, const TimeZone &tz)
Return an instance for the given LocalDateTime and TimeZone.
Definition: ZonedExtra.cpp:23
static ZonedExtra forComponents(int16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, const TimeZone &tz, uint8_t fold=0)
Return an instance for the given LocalDateTime and TimeZone.
Definition: ZonedExtra.cpp:6
static ZonedExtra forEpochSeconds(acetime_t epochSeconds, const TimeZone &tz)
Return an instance for the given epochSeconds and TimeZone.
Definition: ZonedExtra.cpp:16
int32_t acetime_t
Type for the number of seconds from epoch.
Definition: common.h:24