datetime.h
// Copyright (c) 1999-2018 David Muse
// See the COPYING file for more information.
#ifndef RUDIMENTS_DATETIME_H
#define RUDIMENTS_DATETIME_H
#include <rudiments/private/datetimeincludes.h>
class RUDIMENTS_DLLSPEC datetime {
public:
datetime();
~datetime();
bool initialize(const char *tmstring);
bool initialize(time_t seconds);
bool initialize(time_t seconds, time_t microseconds);
bool initialize(const void *tmstruct);
bool getSystemDateAndTime();
bool getHardwareDateAndTime(const char *hwtz);
bool getAdjustedHardwareDateAndTime(const char *hwtz);
bool setSystemDateAndTime();
bool setHardwareDateAndTime(const char *hwtz);
int32_t getHour() const;
int32_t getMinutes() const;
int32_t getSeconds() const;
int32_t getMicroseconds() const;
int32_t getMonth() const;
const char *getMonthName() const;
const char *getMonthAbbreviation() const;
int32_t getDayOfMonth() const;
int32_t getDayOfWeek() const;
int32_t getDayOfYear() const;
int32_t getWeekOfYear() const;
int32_t getYear() const;
int32_t getShortYear() const;
int32_t getCentury() const;
bool isDaylightSavingsTime() const;
const char *getTimeZoneString() const;
int32_t getTimeZoneOffset() const;
bool adjustTimeZone(const char *newtz);
bool adjustTimeZone(const char *newtz, bool ignoredst);
bool setSeconds(int32_t seconds);
bool setMicroseconds(int32_t microseconds);
bool setMinutes(int32_t minutes);
bool setHours(int32_t hours);
bool setDays(int32_t days);
bool setMonths(int32_t months);
bool setYears(int32_t years);
bool addSeconds(int32_t seconds);
bool addMicroseconds(int32_t microseconds);
bool addMinutes(int32_t minutes);
bool addHours(int32_t hours);
bool addDays(int32_t days);
bool addMonths(int32_t months);
bool addYears(int32_t years);
const char *getString();
const char *getString(bool microseconds);
const char *getSqlString();
const char *getSqlString(bool microseconds);
time_t getEpoch() const;
static const char * const *getTimeZoneAbbreviations();
static const int32_t *getTimeZoneOffsets();
static bool validDateTime(const char *string);
static char *getString(time_t seconds);
static char *getString(time_t seconds, time_t microseconds);
static char *getString(const void *tmstruct);
static time_t getEpoch(const char *datestring);
static time_t getEpoch(const void *tmstruct);
static bool parse(const char *datetime,
bool ddmm, bool yyyyddmm,
const char *datedelimiters,
int16_t *year, int16_t *month,
int16_t *day, int16_t *hour,
int16_t *minute, int16_t *second,
int32_t *microsecond, bool *isnegative);
static char *formatAs(const char *format,
int16_t year, int16_t month,
int16_t day, int16_t hour,
int16_t minute, int16_t second,
int32_t microsecond, bool isnegative);
static void setTimeMutex(threadmutex *mtx);
#include <rudiments/private/datetime.h>
};
#endif
datetime
Definition: datetime.h:12
datetime::getString
const char * getString(bool microseconds)
datetime::getTimeZoneString
const char * getTimeZoneString() const
datetime::getTimeZoneOffsets
static const int32_t * getTimeZoneOffsets()
datetime::getEpoch
time_t getEpoch() const
datetime::setMinutes
bool setMinutes(int32_t minutes)
datetime::isDaylightSavingsTime
bool isDaylightSavingsTime() const
datetime::addDays
bool addDays(int32_t days)
datetime::setSeconds
bool setSeconds(int32_t seconds)
datetime::validDateTime
static bool validDateTime(const char *string)
datetime::formatAs
static char * formatAs(const char *format, int16_t year, int16_t month, int16_t day, int16_t hour, int16_t minute, int16_t second, int32_t microsecond, bool isnegative)
datetime::setHours
bool setHours(int32_t hours)
datetime::addMonths
bool addMonths(int32_t months)
datetime::getCentury
int32_t getCentury() const
datetime::setHardwareDateAndTime
bool setHardwareDateAndTime(const char *hwtz)
datetime::datetime
datetime()
datetime::getSystemDateAndTime
bool getSystemDateAndTime()
datetime::getString
const char * getString()
datetime::getHour
int32_t getHour() const
datetime::setYears
bool setYears(int32_t years)
datetime::getMinutes
int32_t getMinutes() const
datetime::adjustTimeZone
bool adjustTimeZone(const char *newtz)
datetime::getDayOfYear
int32_t getDayOfYear() const
datetime::getTimeZoneAbbreviations
static const char *const * getTimeZoneAbbreviations()
datetime::parse
static bool parse(const char *datetime, bool ddmm, bool yyyyddmm, const char *datedelimiters, int16_t *year, int16_t *month, int16_t *day, int16_t *hour, int16_t *minute, int16_t *second, int32_t *microsecond, bool *isnegative)
datetime::initialize
bool initialize(const char *tmstring)
datetime::getMonthName
const char * getMonthName() const
datetime::getShortYear
int32_t getShortYear() const
datetime::initialize
bool initialize(time_t seconds, time_t microseconds)
datetime::getString
static char * getString(const void *tmstruct)
datetime::setTimeMutex
static void setTimeMutex(threadmutex *mtx)
datetime::addMicroseconds
bool addMicroseconds(int32_t microseconds)
datetime::getDayOfMonth
int32_t getDayOfMonth() const
datetime::initialize
bool initialize(time_t seconds)
datetime::adjustTimeZone
bool adjustTimeZone(const char *newtz, bool ignoredst)
datetime::setDays
bool setDays(int32_t days)
datetime::getSeconds
int32_t getSeconds() const
datetime::getMonthAbbreviation
const char * getMonthAbbreviation() const
datetime::getDayOfWeek
int32_t getDayOfWeek() const
datetime::addMinutes
bool addMinutes(int32_t minutes)
datetime::initialize
bool initialize(const void *tmstruct)
datetime::setMonths
bool setMonths(int32_t months)
datetime::getEpoch
static time_t getEpoch(const char *datestring)
datetime::getAdjustedHardwareDateAndTime
bool getAdjustedHardwareDateAndTime(const char *hwtz)
datetime::getSqlString
const char * getSqlString(bool microseconds)
datetime::~datetime
~datetime()
datetime::getMonth
int32_t getMonth() const
datetime::getYear
int32_t getYear() const
datetime::getString
static char * getString(time_t seconds)
datetime::setMicroseconds
bool setMicroseconds(int32_t microseconds)
datetime::getMicroseconds
int32_t getMicroseconds() const
datetime::getString
static char * getString(time_t seconds, time_t microseconds)
datetime::addSeconds
bool addSeconds(int32_t seconds)
datetime::setSystemDateAndTime
bool setSystemDateAndTime()
datetime::getTimeZoneOffset
int32_t getTimeZoneOffset() const
datetime::getEpoch
static time_t getEpoch(const void *tmstruct)
datetime::addYears
bool addYears(int32_t years)
datetime::getSqlString
const char * getSqlString()
datetime::addHours
bool addHours(int32_t hours)
datetime::getWeekOfYear
int32_t getWeekOfYear() const
datetime::getHardwareDateAndTime
bool getHardwareDateAndTime(const char *hwtz)
threadmutex
Definition: threadmutex.h:11