/**
@class wxDateTime
- wxDateTime class represents an absolute moment in the time.
+ wxDateTime class represents an absolute moment in time.
The type @c wxDateTime_t is typedefed as <tt>unsigned short</tt> and is
used to contain the number of years, hours, minutes, seconds and
object later.
*/
wxDateTime();
+
+ /**
+ Copy constructor.
+ */
+ wxDateTime(const wxDateTime& date);
+
/**
Same as Set().
This constructor is named "wxDateTimeFromDMY" in wxPython.
@endWxPythonOnly
*/
- wxDateTime(wxDateTime_t day, Month month = Inv_Month,
+ wxDateTime(wxDateTime_t day, Month month,
int year = Inv_Year, wxDateTime_t hour = 0,
wxDateTime_t minute = 0, wxDateTime_t second = 0,
wxDateTime_t millisec = 0);
@beginWxPythonOnly Unsupported. @endWxPythonOnly
*/
wxDateTime& Set(const struct tm& tm);
+
+ /**
+ Sets the date and time from the broken down representation in the
+ @a wxDateTime::Tm structure.
+ */
+ wxDateTime& Set(const Tm& tm);
+
/**
Sets the date from the so-called Julian Day Number.
/**
Sets the date and time from the parameters.
*/
- wxDateTime& Set(wxDateTime_t day, Month month = Inv_Month,
+ wxDateTime& Set(wxDateTime_t day, Month month,
int year = Inv_Year, wxDateTime_t hour = 0,
wxDateTime_t minute = 0, wxDateTime_t second = 0,
wxDateTime_t millisec = 0);
/**
Returns the date and time in DOS format.
*/
- long unsigned int GetAsDOS() const;
+ unsigned long GetAsDOS() const;
/**
Initialize using the Windows SYSTEMTIME structure.
/**
Returns the day in the given timezone (local one by default).
*/
- short unsigned int GetDay(const TimeZone& tz = Local) const;
+ unsigned short GetDay(const TimeZone& tz = Local) const;
/**
Returns the day of the year (in 1-366 range) in the given timezone
(local one by default).
*/
- short unsigned int GetDayOfYear(const TimeZone& tz = Local) const;
+ unsigned short GetDayOfYear(const TimeZone& tz = Local) const;
/**
Returns the hour in the given timezone (local one by default).
*/
- short unsigned int GetHour(const TimeZone& tz = Local) const;
+ unsigned short GetHour(const TimeZone& tz = Local) const;
/**
Returns the milliseconds in the given timezone (local one by default).
*/
- short unsigned int GetMillisecond(const TimeZone& tz = Local) const;
+ unsigned short GetMillisecond(const TimeZone& tz = Local) const;
/**
Returns the minute in the given timezone (local one by default).
*/
- short unsigned int GetMinute(const TimeZone& tz = Local) const;
+ unsigned short GetMinute(const TimeZone& tz = Local) const;
/**
Returns the month in the given timezone (local one by default).
/**
Returns the seconds in the given timezone (local one by default).
*/
- short unsigned int GetSecond(const TimeZone& tz = Local) const;
+ unsigned short GetSecond(const TimeZone& tz = Local) const;
/**
Returns the number of seconds since Jan 1, 1970. An assert failure will
printf("Current time in Paris:\t%s\n", now.Format("%c", wxDateTime::CET).c_str());
@endcode
- @note This function is accurate up to seconds. UNow() should be used
- for better precision, but it is less efficient and might not be
- available on all platforms.
+ @note This function is accurate up to seconds. UNow() can be used if
+ better precision is required.
@see Today()
*/
static wxDateTime Today();
/**
- Returns the object corresponding to the current time including the
- milliseconds if a function to get time with such precision is available
- on the current platform (supported under most Unices and Win32).
+ Returns the object corresponding to the current UTC time including the
+ milliseconds.
- @see Now()
+ Notice that unlike Now(), this method creates a wxDateTime object
+ corresponding to UTC, not local, time.
+
+ @see Now(), wxGetUTCTimeMillis()
*/
static wxDateTime UNow();
};
/**
Returns @true if this date span is different from the other one.
*/
- bool operator!=(const wxDateSpan&) const;
+ bool operator!=(const wxDateSpan& other) const;
/**
Returns @true if this date span is equal to the other one. Two date
years and months and the same total number of days (counting both days
and weeks).
*/
- bool operator==(const wxDateSpan&) const;
+ bool operator==(const wxDateSpan& other) const;
};
specifier of larger unit, only the rest part is taken, otherwise the
full value is used.
*/
- wxString Format(const wxString& = wxDefaultTimeSpanFormat) const;
+ wxString Format(const wxString& format = wxDefaultTimeSpanFormat) const;
/**
Returns the difference in number of days.