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);
431 m_time += minutes * 60;
439 m_microseconds += microseconds;
440 m_time += m_microseconds / 1000000;
441 m_microseconds %= 1000000;
449 this->addMicroseconds(milliseconds * 1000);
455 void addHours(
long hours) { m_time += hours * 60 * 60; }
467 return m_time < tm.
m_time;
495 return !(*
this == tm);
505 return !(tm < *
this);
515 return !(*
this < tm);
534 addSeconds(-seconds);
543 String toString(ETimeOffset timeOffset = E_LOCAL_TIME)
const;
556 char const * format, ETimeOffset timeOffset = E_LOCAL_TIME)
const;
563 static char const DEFAULT_FORMAT[];
569 String toStringGMT() const BLOCXX_DEPRECATED;
578 static Int16 getGMTOffset();
616 static Int16 localTimeAndOffset(time_t t,
struct tm & tt);
#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...
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.
void addHours(long hours)
Add hours to the date represented by this 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 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.