4 #ifndef RUDIMENTS_DATETIME_H
5 #define RUDIMENTS_DATETIME_H
7 #include <rudiments/private/datetimeincludes.h>
23 static char *getString(time_t seconds);
31 static char *getString(time_t seconds, time_t microseconds);
39 static char *getString(
const void *tmstruct);
47 static time_t getEpoch(
const char *datestring);
55 static time_t getEpoch(
const void *tmstruct);
72 bool initialize(
const char *tmstring);
79 bool initialize(time_t seconds);
86 bool initialize(time_t seconds, time_t microseconds);
99 bool initialize(
const void *tmstruct);
106 bool getSystemDateAndTime();
118 bool getHardwareDateAndTime(
const char *hwtz);
127 bool getAdjustedHardwareDateAndTime(
const char *hwtz);
133 bool setSystemDateAndTime();
145 bool setHardwareDateAndTime(
const char *hwtz);
150 int32_t getHour()
const;
154 int32_t getMinutes()
const;
158 int32_t getSeconds()
const;
162 int32_t getMicroseconds()
const;
166 int32_t getMonth()
const;
171 const char *getMonthName()
const;
176 const char *getMonthAbbreviation()
const;
181 int32_t getDayOfMonth()
const;
186 int32_t getDayOfWeek()
const;
191 int32_t getDayOfYear()
const;
196 int32_t getYear()
const;
200 bool isDaylightSavingsTime()
const;
203 const char *getTimeZoneString()
const;
206 int32_t getTimeZoneOffset()
const;
218 bool adjustTimeZone(
const char *newtz);
230 bool adjustTimeZone(
const char *newtz,
bool ignoredst);
235 bool setSeconds(int32_t seconds);
240 bool setMicroseconds(int32_t microseconds);
244 bool setMinutes(int32_t minutes);
248 bool setHours(int32_t hours);
252 bool setDays(int32_t days);
256 bool setMonths(int32_t months);
260 bool setYears(int32_t years);
264 bool addSeconds(int32_t seconds);
268 bool addMicroseconds(int32_t microseconds);
272 bool addMinutes(int32_t minutes);
276 bool addHours(int32_t hours);
280 bool addDays(int32_t days);
284 bool addMonths(int32_t months);
288 bool addYears(int32_t years);
297 const char *getString();
311 const char *getString(
bool microseconds);
314 time_t getEpoch()
const;
319 static const char *
const *getTimeZoneAbbreviations();
325 static const int32_t *getTimeZoneOffsets();
333 static bool validDateTime(
const char *
string);
348 #include <rudiments/private/datetime.h>