4 #ifndef RUDIMENTS_DATETIME_H
5 #define RUDIMENTS_DATETIME_H
7 #include <rudiments/private/datetimeincludes.h>
9 #ifdef RUDIMENTS_NAMESPACE
13 class datetimeprivate;
27 static char *getString(time_t seconds);
35 static char *getString(
const void *tmstruct);
43 static time_t getEpoch(
const char *datestring);
51 static time_t getEpoch(
const void *tmstruct);
68 bool initialize(
const char *tmstring);
75 bool initialize(time_t seconds);
88 bool initialize(
const void *tmstruct);
95 bool getSystemDateAndTime();
107 bool getHardwareDateAndTime(
const char *hwtz);
116 bool getAdjustedHardwareDateAndTime(
const char *hwtz);
122 bool setSystemDateAndTime();
134 bool setHardwareDateAndTime(
const char *hwtz);
139 int32_t getHour()
const;
143 int32_t getMinutes()
const;
147 int32_t getSeconds()
const;
151 int32_t getMonth()
const;
156 const char *getMonthName()
const;
161 const char *getMonthAbbreviation()
const;
166 int32_t getDayOfMonth()
const;
171 int32_t getDayOfWeek()
const;
176 int32_t getDayOfYear()
const;
181 int32_t getYear()
const;
185 bool isDaylightSavingsTime()
const;
188 const char *getTimeZoneString()
const;
191 int32_t getTimeZoneOffset()
const;
203 bool adjustTimeZone(
const char *newtz);
215 bool adjustTimeZone(
const char *newtz,
bool ignoredst);
220 bool setSeconds(int32_t seconds);
224 bool setMinutes(int32_t minutes);
228 bool setHours(int32_t hours);
232 bool setDays(int32_t days);
236 bool setMonths(int32_t months);
240 bool setYears(int32_t years);
244 bool addSeconds(int32_t seconds);
248 bool addMinutes(int32_t minutes);
252 bool addHours(int32_t hours);
256 bool addDays(int32_t days);
260 bool addMonths(int32_t months);
264 bool addYears(int32_t years);
273 const char *getString();
276 time_t getEpoch()
const;
280 const void *getInternalTimeStructure();
285 static const char *
const *getTimeZoneAbbreviations();
291 static const int32_t *getTimeZoneOffsets();
299 static bool validDateTime(
const char *
string);
312 static void setTimeMutex(
mutex *mtx);
314 #include <rudiments/private/datetime.h>
317 #ifdef RUDIMENTS_NAMESPACE