39#ifndef BLOCXX_DATETIME_HPP_INCLUDE_GUARD_
40#define BLOCXX_DATETIME_HPP_INCLUDE_GUARD_
41#include "blocxx/BLOCXX_config.h"
189 explicit DateTime(time_t t, UInt32 microseconds=0);
212 UInt32 microsecond=0,
213 ETimeOffset timeOffset = E_LOCAL_TIME);
224 int getHour(ETimeOffset timeOffset = E_LOCAL_TIME)
const;
231 int getMinute(ETimeOffset timeOffset = E_LOCAL_TIME)
const;
239 int getSecond(ETimeOffset timeOffset = E_LOCAL_TIME)
const;
247 UInt32 getMicrosecond()
const;
254 int getDay(ETimeOffset timeOffset = E_LOCAL_TIME)
const;
260 int getDow(ETimeOffset timeOffset = E_LOCAL_TIME)
const;
265 int getMonth(ETimeOffset timeOffset = E_LOCAL_TIME)
const;
270 int getYear(ETimeOffset timeOffset = E_LOCAL_TIME)
const;
282 void setHour(
int hour, ETimeOffset timeOffset = E_LOCAL_TIME);
290 void setMinute(
int minute, ETimeOffset timeOffset = E_LOCAL_TIME);
298 void setSecond(
int second, ETimeOffset timeOffset = E_LOCAL_TIME);
305 void setMicrosecond(UInt32 microsecond);
319 ETimeOffset timeOffset = E_LOCAL_TIME);
327 void setDay(
int day, ETimeOffset timeOffset = E_LOCAL_TIME);
336 void setMonth(
int month, ETimeOffset timeOffset = E_LOCAL_TIME);
345 void setYear(
int year, ETimeOffset timeOffset = E_LOCAL_TIME);
355 void set(time_t t, UInt32 microseconds=0);
379 ETimeOffset timeOffset = E_LOCAL_TIME);
390 void addDays(
int days);
407 void addMonths(
int months);
414 void addYears(
int years);
495 return !(*
this == tm);
505 return !(tm < *
this);
515 return !(*
this < tm);
543 String toString(ETimeOffset timeOffset = E_LOCAL_TIME)
const;
556 char const * format, ETimeOffset timeOffset = E_LOCAL_TIME)
const;
578 static Int16 getGMTOffset();
#define BLOCXX_DECLARE_APIEXCEPTION(NAME, LINKAGE_SPEC)
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typical...
The DateTime class is an abstraction for date time data.
ETimeOffset
The values of this enum are passed to various functions to as a flag to indicate the timezone context...
static char const DEFAULT_FORMAT[]
A default date/time format to use with toString().
void addMilliseconds(long milliseconds)
Add milliseconds to the date represented by this object.
void addMinutes(long minutes)
Add minutes to the date represented by this object.
DateTime()
Create a new DateTime object that represents the Epoch (00:00:00 UTC, January 1, 1970)
void addHours(long hours)
Add hours to the date represented by this object.
String toStringGMT() const BLOCXX_DEPRECATED
This is the same as toString(E_UTC_TIME).
void setTime(int hour, int minute, int second, ETimeOffset timeOffset=E_LOCAL_TIME)
Set the time component of this DateTime object.
static Int16 localTimeAndOffset(time_t t, struct tm &tt)
Int16 toLocal(struct tm &tt) const
Converts date/time specified by *this to local time, stored in tt as per the C localtime function,...
static Int16 getGMTOffsetMinutesNow()
Returns the GMT offset (number of minutes) of the system's timezone at the current moment.
void addWeeks(int weeks)
Add week to the date represented by this object.
void addDays(int days)
Add days to the date represented by this object.
tm getTm(ETimeOffset timeOffset) const
void addMicroseconds(long microseconds)
Add microseconds to the date represented by this object.
void addSeconds(long seconds)
Add seconds to the date represented by this object.
This String class is an abstract data type that represents as NULL terminated string of characters.
Char16 operator-(const Char16 &arg1, const Char16 &arg2)
bool operator<(const Array< T > &x, const Array< T > &y)
bool operator<=(const Array< T > &x, const Array< T > &y)
Determine if one Array is less than or equal to another.
bool operator>(const Array< T > &x, const Array< T > &y)
Determine if one Array is greater than another.
bool operator==(const Array< T > &x, const Array< T > &y)
bool operator>=(const Array< T > &x, const Array< T > &y)
Determine if one Array is greater than or equal to another.
bool operator!=(const Array< T > &x, const Array< T > &y)
Determine two Arrays are not equal.