1#ifndef __DCL_DATE_TIME_H__
2#define __DCL_DATE_TIME_H__ 20050323
4#ifndef __DCL_CONFIG_H__
7#ifndef __DCL_STRING_H__
10#ifndef __DCL_EXCEPTION_H__
21#define DATETIME_FORMAT_BUFFER_SIZE 256
29 Date(
int nYear,
int nMonth,
int nDay);
31 void assign(
int nYear,
int nMonth,
int nDay);
42 const Date& operator ++ ();
43 const Date operator ++ (
int);
44 const Date& operator -- ();
45 const Date operator -- (
int);
47 const Date& operator = (
const Date& src);
48 const Date& operator += (
long nDays);
49 const Date& operator -= (
long nDays);
51 void decode(
int& nYear,
int& nMonth,
int& nDay)
const;
72 static bool isValid(
int y,
int m,
int d);
80 int nYear,
int nMonth,
int nDay
85 int& nYear,
int& nMonth,
int& nDay
108 Time(
int nHour,
int nMin,
int nSec,
int nMSec = 0);
109 Time(
long nTotalMSecs);
111 void assign(
int nHour,
int nMin,
int nSec,
int nMSec = 0);
112 void assign(
long nTotalMSecs);
114 const Time& operator = (
const Time& src);
115 const Time& operator += (
long nMilliSeconds);
116 const Time& operator -= (
long nMilliSeconds);
118 void decode(
int& nHour,
int& nMin,
int& nSec,
int& nMSec)
const;
135 static bool isValid(
int nHour,
int nMin,
int nSec,
int nMSec);
161 Interval(
int nDays,
int nMilliSeconds);
163 int nHours,
int nMinutes,
int nSeconds,
164 int nMilliSeconds = 0
166 Interval(int64_t nTotalMilliSeconds);
168 void assign(
int nDays,
int nMilliSeconds);
170 int nHours,
int nMinutes,
int nSeconds,
171 int nMilliSeconds = 0
173 void assign(int64_t nTotalMilliSeconds);
180 int& nHours,
int& nMinutes,
int& nSeconds,
183 void decode(
long& nDays,
long& nMilliSeconds);
220 DateTime(
int nYear,
int nMonth,
int nDay,
221 int nHour,
int nMin,
int nSec,
int nMSec = 0);
223 void assign(time_t time);
224 void assign(
const Date& date,
const Time& time);
225 void assign(
int nYear,
int nMonth,
int nDay,
226 int nHour,
int nMin,
int nSec,
int nMSec = 0);
233 String toString()
const;
DCLCAPI Date operator-(const Date &d, long nDays)
DCLCAPI bool operator>=(const Date &d1, const Date &d2)
DCLCAPI bool operator<=(const Date &d1, const Date &d2)
DCLCAPI bool operator==(const Date &d1, const Date &d2)
DCLCAPI bool operator>(const Date &d1, const Date &d2)
DCLCAPI bool operator!=(const Date &d1, const Date &d2)
DCLCAPI Date operator+(const Date &d, long nDays)
DCLCAPI bool operator<(const Date &d1, const Date &d2)
void assign(int nYear, int nMonth, int nDay)
void decode(int &nYear, int &nMonth, int &nDay) const
static bool isLeapYear(int nYear)
static bool isValid(int y, int m, int d)
static const wchar_t * FORMAT_STRING
String toStringF(const wchar_t *pszFormat=NULL) const
static long convertGregorianToJulian(int nYear, int nMonth, int nDay)
static void convertJulianToGregorian(long uJulianDays, int &nYear, int &nMonth, int &nDay)
static int compare(const DateTime &dt1, const DateTime &dt2)
String toStringF(const wchar_t *pszFormat=NULL) const
static const wchar_t * FORMAT_STRING
static DateTime getCurrentUTCTime()
static int64_t getCurrentTimeMillis()
static DateTime getCurrentLocalTime()
int64_t totalHours() const
int64_t totalMinutes() const
int64_t totalSeconds() const
void assign(int nDays, int nMilliSeconds)
void decode(long &nDays, int &nHours, int &nMinutes, int &nSeconds, int &nMilliSeconds) const
int64_t totalMilliSeconds() const
static const wchar_t * FORMAT_STRING
void decode(int &nHour, int &nMin, int &nSec, int &nMSec) const
void assign(int nHour, int nMin, int nSec, int nMSec=0)
static bool isValid(int nHour, int nMin, int nSec, int nMSec)
long totalMilliSeconds() const
String toStringF(const wchar_t *pszFormat=NULL)
unsigned long m_uMilliSeconds