AceTime  3.0.0
Date and time classes for Arduino that support timezones from the TZ Database.
Functions
zoned_date_time_mutation.h File Reference

Methods that mutate a ZonedDateTime object. More...

#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 [2000, 2099].
 
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 ZonedDateTime object.

The number of mutation methods of a ZonedDateTime 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 ZonedDateTime 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.