-struct tm *wxLocaltime_r(const time_t*, struct tm*);
-#if !defined(__WINDOWS__)
+WXDLLIMPEXP_BASE struct tm *wxLocaltime_r(const time_t*, struct tm*);
+#if wxUSE_THREADS && !defined(__WINDOWS__) && !defined(__WATCOMC__)
// On Windows, localtime _is_ threadsafe!
#warning using pseudo thread-safe wrapper for localtime to emulate localtime_r
#endif
// On Windows, localtime _is_ threadsafe!
#warning using pseudo thread-safe wrapper for localtime to emulate localtime_r
#endif
-struct tm *wxGmtime_r(const time_t*, struct tm*);
-#if !defined(__WINDOWS__)
+WXDLLIMPEXP_BASE struct tm *wxGmtime_r(const time_t*, struct tm*);
+#if wxUSE_THREADS && !defined(__WINDOWS__) && !defined(__WATCOMC__)
// On Windows, gmtime _is_ threadsafe!
#warning using pseudo thread-safe wrapper for gmtime to emulate gmtime_r
#endif
// On Windows, gmtime _is_ threadsafe!
#warning using pseudo thread-safe wrapper for gmtime to emulate gmtime_r
#endif
GMT_6, GMT_5, GMT_4, GMT_3, GMT_2, GMT_1,
GMT0,
GMT1, GMT2, GMT3, GMT4, GMT5, GMT6,
GMT_6, GMT_5, GMT_4, GMT_3, GMT_2, GMT_1,
GMT0,
GMT1, GMT2, GMT3, GMT4, GMT5, GMT6,
- GMT7, GMT8, GMT9, GMT10, GMT11, GMT12,
+ GMT7, GMT8, GMT9, GMT10, GMT11, GMT12, GMT13,
// Note that GMT12 and GMT_12 are not the same: there is a difference
// of exactly one day between them
// Note that GMT12 and GMT_12 are not the same: there is a difference
// of exactly one day between them
A_EST = GMT10, // Eastern Standard Time
A_ESST = GMT11, // Eastern Summer Time
A_EST = GMT10, // Eastern Standard Time
A_ESST = GMT11, // Eastern Summer Time
// TODO add more symbolic timezone names here
// Universal Coordinated Time = the new and politically correct name
// TODO add more symbolic timezone names here
// Universal Coordinated Time = the new and politically correct name
static bool IsLeapYear(int year = Inv_Year, Calendar cal = Gregorian);
// get the century (19 for 1999, 20 for 2000 and -5 for 492 BC)
static bool IsLeapYear(int year = Inv_Year, Calendar cal = Gregorian);
// get the century (19 for 1999, 20 for 2000 and -5 for 492 BC)
// ------------------------------------------------------------------------
// default ctor does not initialize the object, use Set()!
// ------------------------------------------------------------------------
// default ctor does not initialize the object, use Set()!
// from time_t: seconds since the Epoch 00:00:00 UTC, Jan 1, 1970)
#if (!(defined(__VISAGECPP__) && __IBMCPP__ >= 400))
// from time_t: seconds since the Epoch 00:00:00 UTC, Jan 1, 1970)
#if (!(defined(__VISAGECPP__) && __IBMCPP__ >= 400))
// the following functions don't change the values of the other
// fields, i.e. SetMinute() won't change either hour or seconds value
// the following functions don't change the values of the other
// fields, i.e. SetMinute() won't change either hour or seconds value
// sets the date to the given day of the given week in the year,
// returns true on success and false if given date doesn't exist (e.g.
// numWeek is > 53)
// sets the date to the given day of the given week in the year,
// returns true on success and false if given date doesn't exist (e.g.
// numWeek is > 53)
wxDEPRECATED( wxDateTime GetWeek(wxDateTime_t numWeek,
WeekDay weekday = Mon,
WeekFlags flags = Monday_First) const );
wxDEPRECATED( wxDateTime GetWeek(wxDateTime_t numWeek,
WeekDay weekday = Mon,
WeekFlags flags = Monday_First) const );
// returns the date corresponding to the given week day of the given
// week (in ISO notation) of the specified year
// returns the date corresponding to the given week day of the given
// week (in ISO notation) of the specified year
// get the year (returns Inv_Year if date is invalid)
int GetYear(const TimeZone& tz = Local) const
{ return GetTm(tz).year; }
// get the year (returns Inv_Year if date is invalid)
int GetYear(const TimeZone& tz = Local) const
{ return GetTm(tz).year; }
+ // return the timespan for the given number of milliseconds
+ static wxTimeSpan Milliseconds(wxLongLong ms) { return wxTimeSpan(0, 0, 0, ms); }
+ static wxTimeSpan Millisecond() { return Milliseconds(1); }
+
static wxTimeSpan Second() { return Seconds(1); }
// return the timespan for the given number of minutes
static wxTimeSpan Second() { return Seconds(1); }
// return the timespan for the given number of minutes
- return (GetSeconds() / 60l).GetLo();
+ // explicit cast to int suppresses a warning with CodeWarrior and possibly
+ // others (changing the return type to long from int is impossible in 2.8)
+ return (int)((GetSeconds() / 60l).GetLo());