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 _year,
int _month,
int _day);
31 void assign(
int _year,
int _month,
int _day);
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 _days);
49 const Date& operator -= (
long _days);
51 void decode(
int& _year,
int& _month,
int& _day)
const;
72 static bool isValid(
int y,
int m,
int d);
80 int _year,
int _month,
int _day
85 int& _year,
int& _month,
int& _day
108 Time(
int _hour,
int _min,
int _sec,
int _millisecond = 0);
109 Time(
long _milliseconds);
111 void assign(
int _hour,
int _min,
int _sec,
int _millisecond = 0);
112 void assign(
long _milliseconds);
114 const Time& operator = (
const Time& _src);
115 const Time& operator += (
long _milliseconds);
116 const Time& operator -= (
long _milliseconds);
118 void decode(
int& _hour,
int& _min,
int& _sec,
int& _millisecond)
const;
135 static bool isValid(
int _hour,
int _min,
int _sec,
int _millisecond);
161 Interval(
int _days,
int _milliseconds);
163 int _hours,
int _minutes,
int _seconds,
164 int _milliseconds = 0
168 void assign(
int _days,
int _milliseconds);
170 int _hours,
int _minutes,
int _seconds,
171 int _milliseconds = 0
173 void assign(int64_t _milliseconds);
180 int& _hours,
int& _minutes,
int& _seconds,
183 void decode(
long& _days,
long& _milliseconds)
const;
220 DateTime(
int _year,
int _month,
int _day,
221 int _hour,
int _min,
int _sec,
int _millisecond = 0);
223 void assign(time_t _timer);
224 void assign(
const Date& _date,
const Time& _time);
225 void assign(
int _year,
int _month,
int _day,
226 int _hour,
int _min,
int _sec,
int _millisecond = 0);
233 String toString()
const;
DCLCAPI bool operator>=(const Date &_date1, const Date &_date2)
DCLCAPI bool operator>(const Date &_date1, const Date &_date2)
DCLCAPI Date operator-(const Date &_date, long _days)
DCLCAPI Date operator+(const Date &_date, long _days)
DCLCAPI bool operator!=(const Date &_date1, const Date &_date2)
DCLCAPI bool operator<(const Date &_date1, const Date &_date2)
DCLCAPI bool operator==(const Date &_date1, const Date &_date2)
DCLCAPI bool operator<=(const Date &_date1, const Date &_date2)
void assign(int _year, int _month, int _day)
static long convertGregorianToJulian(int _year, int _month, int _day)
static bool isValid(int y, int m, int d)
static void convertJulianToGregorian(long uJulianDays, int &_year, int &_month, int &_day)
String toStringF(const wchar_t *_format=NULL) const
static const wchar_t * FORMAT_STRING
void decode(int &_year, int &_month, int &_day) const
static bool isLeapYear(int _year)
static const wchar_t * FORMAT_STRING
static DateTime getCurrentUTCTime()
static int64_t getCurrentTimeMillis()
String toStringF(const wchar_t *_format=NULL) const
static DateTime getCurrentLocalTime()
static int compare(const DateTime &_dt1, const DateTime &_dt2)
int64_t totalHours() const
int64_t totalMinutes() const
void assign(int _days, int _milliseconds)
int64_t totalSeconds() const
void decode(long &_days, int &_hours, int &_minutes, int &_seconds, int &_milliseconds) const
int64_t totalMilliSeconds() const
String toStringF(const wchar_t *_format=NULL)
void decode(int &_hour, int &_min, int &_sec, int &_millisecond) const
static const wchar_t * FORMAT_STRING
static bool isValid(int _hour, int _min, int _sec, int _millisecond)
unsigned long __milliseconds
void assign(int _hour, int _min, int _sec, int _millisecond=0)
long totalMilliSeconds() const