AceTime  1.7.2
Date and time classes for Arduino that support timezones from the TZ Database, and a system clock that can synchronize from an NTP server or an RTC chip.
Functions
zoned_date_time_mutation.h File Reference
#include <stdint.h>
#include <AceCommon.h>
#include "ZonedDateTime.h"
Include dependency graph for zoned_date_time_mutation.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void ace_time::zoned_date_time_mutation::incrementYear (ZonedDateTime &dateTime)
 Increment the year by one within the interval [0, 99].
 
void ace_time::zoned_date_time_mutation::incrementMonth (ZonedDateTime &dateTime)
 Increment the month by one within the interval [1, 12].
 
void ace_time::zoned_date_time_mutation::incrementDay (ZonedDateTime &dateTime)
 Increment the day by one within the interval [1, 31].
 
void ace_time::zoned_date_time_mutation::incrementHour (ZonedDateTime &dateTime)
 Increment the hour by one within the interval [0, 23].
 
void ace_time::zoned_date_time_mutation::incrementMinute (ZonedDateTime &dateTime)
 Increment the minute by one within the interval [0, 59].
 

Detailed Description

Methods that mutate a DateTime object.

The number of mutation methods of a ZoneDateTime object is basically unlimited, so including them in the ZonedDateTime class would make its API too complex and always incomplete. By extracting them into a separate namespace, we limit the complexity of the ZoneDateTime class and allow additional mutation methods to be added to this namespace by downstream applications.

No validation is performed during the mutation operation. Client code is normally expected to call the toEpochSeconds() method to convert this into an acetime_t, then later convert it back to human-readable components using the forEpochSeconds() factory method.

Example:

ZonedDateTime dt(...);
zoned_date_time_mutation::incrementDay(dt);

Definition in file zoned_date_time_mutation.h.