// NB: this struct should always be kept normalized (i.e. mon should
// be < 12, 1 <= day <= 31 &c), so use AddMonths(), AddDays()
// instead of modifying the member fields directly!
- struct Tm
+ struct WXDLLEXPORT Tm
{
wxDateTime_t msec, sec, min, hour, mday;
Month mon;
wxDateTime() { }
// from time_t: seconds since the Epoch 00:00:00 UTC, Jan 1, 1970)
+#if (!(defined(__VISAGECPP__) && __IBMCPP__ >= 400))
+// VA C++ confuses this with wxDateTime(double jdn) thinking it is a duplicate declaration
inline wxDateTime(time_t timet);
+#endif
// from broken down time/date (only for standard Unix range)
inline wxDateTime(const struct tm& tm);
// from broken down time/date (any range)
// set to the current time
inline wxDateTime& SetToCurrent();
+#if (!(defined(__VISAGECPP__) && __IBMCPP__ >= 400))
+// VA C++ confuses this with wxDateTime(double jdn) thinking it is a duplicate declaration
// set to given time_t value
inline wxDateTime& Set(time_t timet);
+#endif
// set to given broken down time/date
wxDateTime& Set(const struct tm& tm);
inline time_t GetTicks() const;
// get the year (returns Inv_Year if date is invalid)
- int GetYear(const TimeZone& tz = Local) const
+ int GetYear(const TimeZone& tz = Local) const
{ return GetTm(tz).year; }
// get the month (Inv_Month if date is invalid)
- Month GetMonth(const TimeZone& tz = Local) const
+ Month GetMonth(const TimeZone& tz = Local) const
{ return (Month)GetTm(tz).mon; }
// get the month day (in 1..31 range, 0 if date is invalid)
- wxDateTime_t GetDay(const TimeZone& tz = Local) const
+ wxDateTime_t GetDay(const TimeZone& tz = Local) const
{ return GetTm(tz).mday; }
// get the day of the week (Inv_WeekDay if date is invalid)
- WeekDay GetWeekDay(const TimeZone& tz = Local) const
+ WeekDay GetWeekDay(const TimeZone& tz = Local) const
{ return GetTm(tz).GetWeekDay(); }
// get the hour of the day
- wxDateTime_t GetHour(const TimeZone& tz = Local) const
+ wxDateTime_t GetHour(const TimeZone& tz = Local) const
{ return GetTm(tz).hour; }
// get the minute
- wxDateTime_t GetMinute(const TimeZone& tz = Local) const
+ wxDateTime_t GetMinute(const TimeZone& tz = Local) const
{ return GetTm(tz).min; }
// get the second
- wxDateTime_t GetSecond(const TimeZone& tz = Local) const
+ wxDateTime_t GetSecond(const TimeZone& tz = Local) const
{ return GetTm(tz).sec; }
// get milliseconds
- wxDateTime_t GetMillisecond(const TimeZone& tz = Local) const
+ wxDateTime_t GetMillisecond(const TimeZone& tz = Local) const
{ return GetTm(tz).msec; }
// get the day since the year start (1..366, 0 if date is invalid)
// ------------------------------------------------------------------------
// return the timespan for the given number of seconds
- static wxTimeSpan Seconds(int sec) { return wxTimeSpan(0, 0, sec); }
+ static wxTimeSpan Seconds(long sec) { return wxTimeSpan(0, 0, sec); }
static wxTimeSpan Second() { return Seconds(1); }
// return the timespan for the given number of minutes
- static wxTimeSpan Minutes(int min) { return wxTimeSpan(0, min, 0 ); }
+ static wxTimeSpan Minutes(long min) { return wxTimeSpan(0, min, 0 ); }
static wxTimeSpan Minute() { return Minutes(1); }
// return the timespan for the given number of hours
- static wxTimeSpan Hours(int hours) { return wxTimeSpan(hours, 0, 0); }
+ static wxTimeSpan Hours(long hours) { return wxTimeSpan(hours, 0, 0); }
static wxTimeSpan Hour() { return Hours(1); }
// return the timespan for the given number of days
- static wxTimeSpan Days(int days) { return Hours(24 * days); }
+ static wxTimeSpan Days(long days) { return Hours(24 * days); }
static wxTimeSpan Day() { return Days(1); }
// return the timespan for the given number of weeks
- static wxTimeSpan Weeks(int days) { return Days(7 * days); }
+ static wxTimeSpan Weeks(long days) { return Days(7 * days); }
static wxTimeSpan Week() { return Weeks(1); }
// default ctor constructs the 0 time span
// from separate values for each component, date set to 0 (hours are
// not restricted to 0..24 range, neither are minutes, seconds or
// milliseconds)
- inline wxTimeSpan(int hours,
- int minutes = 0,
- int seconds = 0,
- int milliseconds = 0);
+ inline wxTimeSpan(long hours,
+ long minutes = 0,
+ long seconds = 0,
+ long milliseconds = 0);
// default copy ctor is ok
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxDateTimeHolidayAuthority;
-WX_DEFINE_ARRAY(wxDateTimeHolidayAuthority *, wxHolidayAuthoritiesArray);
+WX_DEFINE_EXPORTED_ARRAY(wxDateTimeHolidayAuthority *, wxHolidayAuthoritiesArray);
+class wxDateTimeHolidaysModule;
class WXDLLEXPORT wxDateTimeHolidayAuthority
{
+ friend wxDateTimeHolidaysModule;
public:
// returns TRUE if the given date is a holiday
static bool IsHoliday(const wxDateTime& dt);