2000-03-09 20:15:17 -05:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
%% Name: datetime.tex
|
|
|
|
%% Purpose: wxDateTime documentation
|
|
|
|
%% Author: Vadim Zeitlin
|
|
|
|
%% Modified by:
|
|
|
|
%% Created: 07.03.00
|
|
|
|
%% RCS-ID: $Id$
|
|
|
|
%% Copyright: (c) Vadim Zeitlin
|
2000-07-15 15:51:35 -04:00
|
|
|
%% License: wxWindows license
|
2000-03-09 20:15:17 -05:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\section{\class{wxDateTime}}\label{wxdatetime}
|
|
|
|
|
|
|
|
wxDateTime class represents an absolute moment in the time.
|
|
|
|
|
|
|
|
\wxheading{Types}
|
|
|
|
|
|
|
|
The type {\tt wxDateTime\_t} is typedefed as {\tt unsigned short} and is used
|
|
|
|
to contain the number of years, hours, minutes, seconds and milliseconds.
|
|
|
|
|
|
|
|
\wxheading{Constants}
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
Global constant {\tt wxDefaultDateTime} and synonym for it {\tt wxInvalidDateTime} are defined. This constant will be different from any valid
|
2000-03-09 20:15:17 -05:00
|
|
|
wxDateTime object.
|
|
|
|
|
|
|
|
All the following constants are defined inside wxDateTime class (i.e., to refer to
|
|
|
|
them you should prepend their names with {\tt wxDateTime::}).
|
|
|
|
|
2000-03-14 19:21:49 -05:00
|
|
|
Time zone symbolic names:
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
enum TZ
|
|
|
|
{
|
|
|
|
// the time in the current time zone
|
|
|
|
Local,
|
|
|
|
|
|
|
|
// zones from GMT (= Greenwhich Mean Time): they're guaranteed to be
|
|
|
|
// consequent numbers, so writing something like `GMT0 + offset' is
|
|
|
|
// safe if abs(offset) <= 12
|
|
|
|
|
|
|
|
// underscore stands for minus
|
|
|
|
GMT_12, GMT_11, GMT_10, GMT_9, GMT_8, GMT_7,
|
|
|
|
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,
|
|
|
|
// Note that GMT12 and GMT_12 are not the same: there is a difference
|
|
|
|
// of exactly one day between them
|
|
|
|
|
|
|
|
// some symbolic names for TZ
|
|
|
|
|
|
|
|
// Europe
|
|
|
|
WET = GMT0, // Western Europe Time
|
|
|
|
WEST = GMT1, // Western Europe Summer Time
|
|
|
|
CET = GMT1, // Central Europe Time
|
|
|
|
CEST = GMT2, // Central Europe Summer Time
|
|
|
|
EET = GMT2, // Eastern Europe Time
|
|
|
|
EEST = GMT3, // Eastern Europe Summer Time
|
|
|
|
MSK = GMT3, // Moscow Time
|
|
|
|
MSD = GMT4, // Moscow Summer Time
|
|
|
|
|
|
|
|
// US and Canada
|
|
|
|
AST = GMT_4, // Atlantic Standard Time
|
|
|
|
ADT = GMT_3, // Atlantic Daylight Time
|
|
|
|
EST = GMT_5, // Eastern Standard Time
|
|
|
|
EDT = GMT_4, // Eastern Daylight Saving Time
|
|
|
|
CST = GMT_6, // Central Standard Time
|
|
|
|
CDT = GMT_5, // Central Daylight Saving Time
|
|
|
|
MST = GMT_7, // Mountain Standard Time
|
|
|
|
MDT = GMT_6, // Mountain Daylight Saving Time
|
|
|
|
PST = GMT_8, // Pacific Standard Time
|
|
|
|
PDT = GMT_7, // Pacific Daylight Saving Time
|
|
|
|
HST = GMT_10, // Hawaiian Standard Time
|
|
|
|
AKST = GMT_9, // Alaska Standard Time
|
|
|
|
AKDT = GMT_8, // Alaska Daylight Saving Time
|
|
|
|
|
|
|
|
// Australia
|
|
|
|
|
|
|
|
A_WST = GMT8, // Western Standard Time
|
|
|
|
A_CST = GMT12 + 1, // Central Standard Time (+9.5)
|
|
|
|
A_EST = GMT10, // Eastern Standard Time
|
|
|
|
A_ESST = GMT11, // Eastern Summer Time
|
|
|
|
|
|
|
|
// Universal Coordinated Time = the new and politically correct name
|
|
|
|
// for GMT
|
|
|
|
UTC = GMT0
|
|
|
|
};
|
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
Month names: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec and
|
2000-07-15 15:51:35 -04:00
|
|
|
Inv\_Month for an invalid.month value are the values of {\tt wxDateTime::Month}
|
2000-03-09 20:15:17 -05:00
|
|
|
enum.
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Likewise, Sun, Mon, Tue, Wed, Thu, Fri, Sat, and Inv\_WeekDay are the values in
|
2000-03-09 20:15:17 -05:00
|
|
|
{\tt wxDateTime::WeekDay} enum.
|
|
|
|
|
|
|
|
Finally, Inv\_Year is defined to be an invalid value for year parameter.
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{GetMonthName()}{wxdatetimegetmonthname} and
|
|
|
|
\helpref{GetWeekDayName}{wxdatetimegetweekdayname} functions use the followign
|
|
|
|
flags:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
enum NameFlags
|
|
|
|
{
|
|
|
|
Name_Full = 0x01, // return full name
|
|
|
|
Name_Abbr = 0x02 // return abbreviated name
|
|
|
|
};
|
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
Several functions accept an extra parameter specifying the calendar to use
|
|
|
|
(although most of them only support now the Gregorian calendar). This
|
|
|
|
parameters is one of the following values:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
enum Calendar
|
|
|
|
{
|
|
|
|
Gregorian, // calendar currently in use in Western countries
|
|
|
|
Julian // calendar in use since -45 until the 1582 (or later)
|
|
|
|
};
|
|
|
|
\end{verbatim}
|
|
|
|
|
2001-01-02 02:59:43 -05:00
|
|
|
Date calculations often depend on the country and wxDateTime allows to set the
|
|
|
|
country whose conventions should be used using
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{SetCountry}{wxdatetimesetcountry}. It takes one of the following
|
|
|
|
values as parameter:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
enum Country
|
|
|
|
{
|
|
|
|
Country_Unknown, // no special information for this country
|
|
|
|
Country_Default, // set the default country with SetCountry() method
|
|
|
|
// or use the default country with any other
|
|
|
|
|
|
|
|
Country_WesternEurope_Start,
|
|
|
|
Country_EEC = Country_WesternEurope_Start,
|
|
|
|
France,
|
|
|
|
Germany,
|
|
|
|
UK,
|
|
|
|
Country_WesternEurope_End = UK,
|
|
|
|
|
|
|
|
Russia,
|
|
|
|
|
|
|
|
USA
|
|
|
|
};
|
|
|
|
\end{verbatim}
|
|
|
|
|
2002-08-22 16:14:47 -04:00
|
|
|
Different parts of the world use different conventions for the week start.
|
|
|
|
In some countries, the week starts on Sunday, while in others -- on Monday.
|
2000-07-15 15:51:35 -04:00
|
|
|
The ISO standard doesn't address this issue, so we support both conventions in
|
2001-01-02 02:59:43 -05:00
|
|
|
the functions whose result depends on it (\helpref{GetWeekOfYear}{wxdatetimegetweekofyear} and
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{GetWeekOfMonth}{wxdatetimegetweekofmonth}).
|
|
|
|
|
|
|
|
The desired behvaiour may be specified by giving one of the following
|
|
|
|
constants as argument to these functions:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
enum WeekFlags
|
|
|
|
{
|
|
|
|
Default_First, // Sunday_First for US, Monday_First for the rest
|
|
|
|
Monday_First, // week starts with a Monday
|
|
|
|
Sunday_First // week starts with a Sunday
|
|
|
|
};
|
|
|
|
\end{verbatim}
|
|
|
|
|
2000-03-09 20:15:17 -05:00
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
No base class
|
|
|
|
|
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/datetime.h>
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{Date classes overview}{wxdatetimeoverview},\rtfsp
|
2001-03-13 08:17:46 -05:00
|
|
|
\helpref{wxTimeSpan}{wxtimespan},\rtfsp
|
|
|
|
\helpref{wxDateSpan}{wxdatespan},\rtfsp
|
2000-03-09 20:15:17 -05:00
|
|
|
\helpref{wxCalendarCtrl}{wxcalendarctrl}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Function groups}}}
|
|
|
|
|
|
|
|
\membersection{Static functions}
|
|
|
|
|
2000-03-14 19:21:49 -05:00
|
|
|
For convenience, all static functions are collected here. These functions
|
2000-03-09 20:15:17 -05:00
|
|
|
either set or return the static variables of wxDateSpan (the country), return
|
|
|
|
the current moment, year, month or number of days in it, or do some general
|
|
|
|
calendar-related actions.
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Please note that although several function accept an extra {\it Calendar}
|
|
|
|
parameter, it is currently ignored as only the Gregorian calendar is
|
|
|
|
supported. Future versions will support other calendars.
|
|
|
|
|
2001-01-02 02:59:43 -05:00
|
|
|
\pythonnote{These methods are standalone functions named
|
2001-05-24 06:39:33 -04:00
|
|
|
{\tt wxDateTime\_<StaticMethodName>} in wxPython.}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2000-03-09 20:15:17 -05:00
|
|
|
\helpref{SetCountry}{wxdatetimesetcountry}\\
|
|
|
|
\helpref{GetCountry}{wxdatetimegetcountry}\\
|
|
|
|
\helpref{IsWestEuropeanCountry}{wxdatetimeiswesteuropeancountry}\\
|
|
|
|
\helpref{GetCurrentYear}{wxdatetimegetcurrentyear}\\
|
|
|
|
\helpref{ConvertYearToBC}{wxdatetimeconvertyeartobc}\\
|
|
|
|
\helpref{GetCurrentMonth}{wxdatetimegetcurrentmonth}\\
|
|
|
|
\helpref{IsLeapYear}{wxdatetimeisleapyear}\\
|
|
|
|
\helpref{GetCentury}{wxdatetimegetcentury}\\
|
|
|
|
\helpref{GetNumberOfDays}{wxdatetimegetnumberofdays}\\
|
|
|
|
\helpref{GetNumberOfDays}{wxdatetimegetnumberofdays}\\
|
|
|
|
\helpref{GetMonthName}{wxdatetimegetmonthname}\\
|
|
|
|
\helpref{GetWeekDayName}{wxdatetimegetweekdayname}\\
|
|
|
|
\helpref{GetAmPmStrings}{wxdatetimegetampmstrings}\\
|
|
|
|
\helpref{IsDSTApplicable}{wxdatetimeisdstapplicable}\\
|
|
|
|
\helpref{GetBeginDST}{wxdatetimegetbegindst}\\
|
|
|
|
\helpref{GetEndDST}{wxdatetimegetenddst}\\
|
|
|
|
\helpref{Now}{wxdatetimenow}\\
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{UNow}{wxdatetimeunow}\\
|
2000-03-09 20:15:17 -05:00
|
|
|
\helpref{Today}{wxdatetimetoday}
|
|
|
|
|
|
|
|
\membersection{Constructors, assignment operators and setters}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Constructors and various {\tt Set()} methods are collected here. If you
|
|
|
|
construct a date object from separate values for day, month and year, you
|
|
|
|
should use \helpref{IsValid}{wxdatetimeisvalid} method to check that the
|
|
|
|
values were correct as constructors can not return an error code.
|
|
|
|
|
|
|
|
\helpref{wxDateTime()}{wxdatetimewxdatetimedef}\\
|
|
|
|
\helpref{wxDateTime(time\_t)}{wxdatetimewxdatetimetimet}\\
|
|
|
|
\helpref{wxDateTime(struct tm)}{wxdatetimewxdatetimetm}\\
|
|
|
|
%\helpref{wxDateTime(struct Tm)}{wxdatetimewxdatetimetm} - Tm not documented yet\\
|
|
|
|
\helpref{wxDateTime(double jdn)}{wxdatetimewxdatetimejdn}\\
|
|
|
|
\helpref{wxDateTime(h, m, s, ms)}{wxdatetimewxdatetimetime}\\
|
|
|
|
\helpref{wxDateTime(day, mon, year, h, m, s, ms)}{wxdatetimewxdatetimedate}\\
|
|
|
|
\helpref{SetToCurrent}{wxdatetimesettocurrent}\\
|
|
|
|
\helpref{Set(time\_t)}{wxdatetimesettimet}\\
|
|
|
|
\helpref{Set(struct tm)}{wxdatetimesettm}\\
|
|
|
|
%\helpref{Set(struct Tm)}{wxdatetimesettm} - Tm not documented yet\\
|
|
|
|
\helpref{Set(double jdn)}{wxdatetimesetjdn}\\
|
|
|
|
\helpref{Set(h, m, s, ms)}{wxdatetimesettime}\\
|
|
|
|
\helpref{Set(day, mon, year, h, m, s, ms)}{wxdatetimesetdate}\\
|
2002-12-04 09:11:26 -05:00
|
|
|
\helpref{SetFromDOS(unsigned long ddt)}{wxdatetimesetfromdos}\\
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{ResetTime}{wxdatetimeresettime}\\
|
|
|
|
\helpref{SetYear}{wxdatetimesetyear}\\
|
|
|
|
\helpref{SetMonth}{wxdatetimesetmonth}\\
|
|
|
|
\helpref{SetDay}{wxdatetimesetdate}\\
|
|
|
|
\helpref{SetHour}{wxdatetimesethour}\\
|
|
|
|
\helpref{SetMinute}{wxdatetimesetminute}\\
|
|
|
|
\helpref{SetSecond}{wxdatetimesetsecond}\\
|
|
|
|
\helpref{SetMillisecond}{wxdatetimesetmillisecond}\\
|
|
|
|
\helpref{operator$=$(time\_t)}{wxdatetimeoperatoreqtimet}\\
|
|
|
|
\helpref{operator$=$(struct tm)}{wxdatetimeoperatoreqtm}
|
|
|
|
%\helpref{operator$=$(struct Tm)}{wxdatetimeoperatortm2}
|
|
|
|
|
2000-03-09 20:15:17 -05:00
|
|
|
\membersection{Accessors}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Here are the trivial accessors. Other functions, which might have to perform
|
2001-01-02 02:59:43 -05:00
|
|
|
some more complicated calculations to find the answer are under the
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{Calendar calculations}{wxdatetimecalculations} section.
|
|
|
|
|
|
|
|
\helpref{IsValid}{wxdatetimeisvalid}\\
|
|
|
|
\helpref{GetTicks}{wxdatetimegetticks}\\
|
|
|
|
\helpref{GetYear}{wxdatetimegetyear}\\
|
|
|
|
\helpref{GetMonth}{wxdatetimegetmonth}\\
|
|
|
|
\helpref{GetDay}{wxdatetimegetday}\\
|
|
|
|
\helpref{GetWeekDay}{wxdatetimegetweekday}\\
|
|
|
|
\helpref{GetHour}{wxdatetimegethour}\\
|
2002-08-22 16:14:47 -04:00
|
|
|
\helpref{GetMinute}{wxdatetimegetminute}\\
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{GetSecond}{wxdatetimegetsecond}\\
|
|
|
|
\helpref{GetMillisecond}{wxdatetimegetmillisecond}\\
|
|
|
|
\helpref{GetDayOfYear}{wxdatetimegetdayofyear}\\
|
|
|
|
\helpref{GetWeekOfYear}{wxdatetimegetweekofyear}\\
|
|
|
|
\helpref{GetWeekOfMonth}{wxdatetimegetweekofmonth}\\
|
|
|
|
\helpref{GetYearDay}{wxdatetimegetyearday}\\
|
|
|
|
\helpref{IsWorkDay}{wxdatetimeisworkday}\\
|
2002-12-04 09:11:26 -05:00
|
|
|
\helpref{IsGregorianDate}{wxdatetimeisgregoriandate}\\
|
|
|
|
\helpref{GetAsDOS}{wxdatetimegetasdos}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2000-03-09 20:15:17 -05:00
|
|
|
\membersection{Date comparison}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
There are several function to allow date comparison. To supplement them, a few
|
|
|
|
global operators $>$, $<$ etc taking wxDateTime are defined.
|
|
|
|
|
|
|
|
\helpref{IsEqualTo}{wxdatetimeisequalto}\\
|
|
|
|
\helpref{IsEarlierThan}{wxdatetimeisearlierthan}\\
|
|
|
|
\helpref{IsLaterThan}{wxdatetimeislaterthan}\\
|
|
|
|
\helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween}\\
|
|
|
|
\helpref{IsBetween}{wxdatetimeisbetween}\\
|
|
|
|
\helpref{IsSameDate}{wxdatetimeissamedate}\\
|
|
|
|
\helpref{IsSameTime}{wxdatetimeissametime}\\
|
|
|
|
\helpref{IsEqualUpTo}{wxdatetimeisequalupto}
|
|
|
|
|
2000-03-09 20:15:17 -05:00
|
|
|
\membersection{Date arithmetics}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
These functions carry out \helpref{arithmetics}{tdatearithm} on the wxDateTime
|
|
|
|
objects. As explained in the overview, either wxTimeSpan or wxDateSpan may be
|
|
|
|
added to wxDateTime, hence all functions are overloaded to accept both
|
|
|
|
arguments.
|
|
|
|
|
|
|
|
Also, both {\tt Add()} and {\tt Subtract()} have both const and non-const
|
|
|
|
version. The first one returns a new obejct which represents the
|
|
|
|
sum/difference of the original one with the argument while the second form
|
|
|
|
modifies the object to which it is applied. The operators $-=$ and $+=$ are
|
|
|
|
defined to be equivalent to the second forms of these functions.
|
|
|
|
|
|
|
|
\helpref{Add(wxTimeSpan)}{wxdatetimeaddts}\\
|
|
|
|
\helpref{Add(wxDateSpan)}{wxdatetimeaddds}\\
|
|
|
|
\helpref{Subtract(wxTimeSpan)}{wxdatetimesubtractts}\\
|
|
|
|
\helpref{Subtract(wxDateSpan)}{wxdatetimesubtractds}\\
|
|
|
|
\helpref{Subtract(wxDateTime)}{wxdatetimesubtractdt}\\
|
|
|
|
\helpref{oparator$+=$(wxTimeSpan)}{wxdatetimeaddts}\\
|
|
|
|
\helpref{oparator$+=$(wxDateSpan)}{wxdatetimeaddds}\\
|
|
|
|
\helpref{oparator$-=$(wxTimeSpan)}{wxdatetimesubtractts}\\
|
|
|
|
\helpref{oparator$-=$(wxDateSpan)}{wxdatetimesubtractds}
|
|
|
|
|
2000-03-09 20:15:17 -05:00
|
|
|
\membersection{Parsing and formatting dates}
|
|
|
|
|
2002-08-22 16:14:47 -04:00
|
|
|
These functions convert wxDateTime obejcts to and from text. The
|
2000-07-15 15:51:35 -04:00
|
|
|
conversions to text are mostly trivial: you can either do it using the default
|
2002-08-22 16:14:47 -04:00
|
|
|
date and time representations for the current locale (
|
|
|
|
\helpref{FormatDate}{wxdatetimeformatdate} and
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{FormatTime}{wxdatetimeformattime}), using the international standard
|
2002-08-22 16:14:47 -04:00
|
|
|
representation defined by ISO 8601 (
|
|
|
|
\helpref{FormatISODate}{wxdatetimeformatisodate} and
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{FormatISOTime}{wxdatetimeformatisotime}) or by specifying any format
|
|
|
|
at all and using \helpref{Format}{wxdatetimeformat} directly.
|
|
|
|
|
|
|
|
The conversions from text are more interesting, as there are much more
|
2002-08-22 16:14:47 -04:00
|
|
|
possibilities to care about. The simplest cases can be taken care of with
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{ParseFormat}{wxdatetimeparseformat} which can parse any date in the
|
|
|
|
given (rigid) format. \helpref{ParseRfc822Date}{wxdatetimeparserfc822date} is
|
2002-08-22 16:14:47 -04:00
|
|
|
another function for parsing dates in predefined format -- the one of RFC 822
|
2000-07-15 15:51:35 -04:00
|
|
|
which (still...) defines the format of email messages on the Internet. This
|
2002-08-22 16:14:47 -04:00
|
|
|
format can not be described with {\tt strptime(3)}-like format strings used by
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{Format}{wxdatetimeformat}, hence the need for a separate function.
|
|
|
|
|
2001-01-02 02:59:43 -05:00
|
|
|
But the most interesting functions are
|
2002-08-22 16:14:47 -04:00
|
|
|
\helpref{ParseTime}{wxdatetimeparsetime},
|
2001-01-02 02:59:43 -05:00
|
|
|
\helpref{ParseDate}{wxdatetimeparsedate} and
|
2002-08-22 16:14:47 -04:00
|
|
|
\helpref{ParseDateTime}{wxdatetimeparsedatetime}. They try to parse the date
|
|
|
|
ans time (or only one of them) in `free' format, i.e. allow them to be
|
|
|
|
specified in any of possible ways. These functions will usually be used to
|
|
|
|
parse the (interactive) user input which is not bound to be in any predefined
|
|
|
|
format. As an example, \helpref{ParseDateTime}{wxdatetimeparsedatetime} can
|
|
|
|
parse the strings such as {\tt "tomorrow"}, {\tt "March first"} and even
|
|
|
|
{\tt "next Sunday"}.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\helpref{ParseRfc822Date}{wxdatetimeparserfc822date}\\
|
|
|
|
\helpref{ParseFormat}{wxdatetimeparseformat}\\
|
|
|
|
\helpref{ParseDateTime}{wxdatetimeparsedatetime}\\
|
|
|
|
\helpref{ParseDate}{wxdatetimeparsedate}\\
|
|
|
|
\helpref{ParseTime}{wxdatetimeparsetime}\\
|
|
|
|
\helpref{Format}{wxdatetimeformat}\\
|
|
|
|
\helpref{FormatDate}{wxdatetimeformatdate}\\
|
|
|
|
\helpref{FormatTime}{wxdatetimeformattime}\\
|
|
|
|
\helpref{FormatISODate}{wxdatetimeformatisodate}\\
|
|
|
|
\helpref{FormatISOTime}{wxdatetimeformatisotime}
|
|
|
|
|
|
|
|
\membersection{Calendar calculations}\label{wxdatetimecalculations}
|
|
|
|
|
|
|
|
The functions in this section perform the basic calendar calculations, mostly
|
|
|
|
related to the week days. They allow to find the given week day in the
|
|
|
|
week with given number (either in the month or in the year) and so on.
|
|
|
|
|
|
|
|
All (non-const) functions in this section don't modify the time part of the
|
2002-08-22 16:14:47 -04:00
|
|
|
wxDateTime -- they only work with the date part of it.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\helpref{SetToWeekDayInSameWeek}{wxdatetimesettoweekdayinsameweek}\\
|
|
|
|
\helpref{GetWeekDayInSameWeek}{wxdatetimegetweekdayinsameweek}\\
|
|
|
|
\helpref{SetToNextWeekDay}{wxdatetimesettonextweekday}\\
|
|
|
|
\helpref{GetNextWeekDay}{wxdatetimegetnextweekday}\\
|
|
|
|
\helpref{SetToPrevWeekDay}{wxdatetimesettoprevweekday}\\
|
|
|
|
\helpref{GetPrevWeekDay}{wxdatetimegetprevweekday}\\
|
|
|
|
\helpref{SetToWeekDay}{wxdatetimesettoweekday}\\
|
|
|
|
\helpref{GetWeekDay}{wxdatetimegetweekday2}\\
|
|
|
|
\helpref{SetToLastWeekDay}{wxdatetimesettolastweekday}\\
|
|
|
|
\helpref{GetLastWeekDay}{wxdatetimegetlastweekday}\\
|
|
|
|
\helpref{SetToTheWeek}{wxdatetimesettotheweek}\\
|
|
|
|
\helpref{GetWeek}{wxdatetimegetweek}\\
|
|
|
|
\helpref{SetToLastMonthDay}{wxdatetimesettolastmonthday}\\
|
|
|
|
\helpref{GetLastMonthDay}{wxdatetimegetlastmonthday}\\
|
|
|
|
\helpref{SetToYearDay}{wxdatetimesettoyearday}\\
|
|
|
|
\helpref{GetYearDay}{wxdatetimegetyearday}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\membersection{Astronomical/historical functions}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Some degree of support for the date units used in astronomy and/or history is
|
|
|
|
provided. You can construct a wxDateTime object from a
|
|
|
|
\helpref{JDN}{wxdatetimesetjdn} and you may also get its JDN,
|
|
|
|
\helpref{MJD}{wxdatetimegetmodifiedjuliandaynumber} or
|
|
|
|
\helpref{Rata Die number}{wxdatetimegetratadie} from it.
|
|
|
|
|
|
|
|
\helpref{wxDateTime(double jdn)}{wxdatetimewxdatetimejdn}\\
|
|
|
|
\helpref{Set(double jdn)}{wxdatetimesetjdn}\\
|
|
|
|
\helpref{GetJulianDayNumber}{wxdatetimegetjuliandaynumber}\\
|
|
|
|
\helpref{GetJDN}{wxdatetimegetjdn}\\
|
|
|
|
\helpref{GetModifiedJulianDayNumber}{wxdatetimegetmodifiedjuliandaynumber}\\
|
|
|
|
\helpref{GetMJD}{wxdatetimegetmjd}\\
|
|
|
|
\helpref{GetRataDie}{wxdatetimegetratadie}
|
|
|
|
|
|
|
|
\membersection{Time zone and DST support}
|
|
|
|
|
|
|
|
Please see the \helpref{time zone overview}{tdatetimezones} for more
|
|
|
|
information about time zones. ormally, these functions should be rarely used.
|
|
|
|
|
|
|
|
\helpref{ToTimezone}{wxdatetimetotimezone}\\
|
|
|
|
\helpref{MakeTimezone}{wxdatetimemaketimezone}\\
|
|
|
|
\helpref{ToGMT}{wxdatetimetogmt}\\
|
|
|
|
\helpref{MakeGMT}{wxdatetimemakegmt}\\
|
|
|
|
\helpref{GetBeginDST}{wxdatetimegetbegindst}\\
|
|
|
|
\helpref{GetEndDST}{wxdatetimegetenddst}\\
|
|
|
|
\helpref{IsDST}{wxdatetimeisdst}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\helponly{\insertatlevel{2}{
|
|
|
|
|
|
|
|
\wxheading{Members}
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% static functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::ConvertYearToBC}\label{wxdatetimeconvertyeartobc}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\func{static int}{ConvertYearToBC}{\param{int }{year}}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
Converts the year in absolute notation (i.e. a number which can be negative,
|
|
|
|
positive or zero) to the year in BC/AD notation. For the positive years,
|
|
|
|
nothing is done, but the year 0 is year 1 BC and so for other years there is a
|
|
|
|
difference of 1.
|
|
|
|
|
|
|
|
This function should be used like this:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
wxDateTime dt(...);
|
|
|
|
int y = dt.GetYear();
|
|
|
|
printf("The year is %d%s", wxDateTime::ConvertYearToBC(y), y > 0 ? "AD" : "BC");
|
|
|
|
\end{verbatim}
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::GetAmPmStrings}\label{wxdatetimegetampmstrings}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static void}{GetAmPmStrings}{\param{wxString *}{am}, \param{wxString *}{pm}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Returns the translations of the strings {\tt AM} and {\tt PM} used for time
|
|
|
|
formatting for the current locale. Either of the pointers may be {\tt NULL} if
|
|
|
|
the corresponding value is not needed.
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::GetBeginDST}\label{wxdatetimegetbegindst}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static wxDateTime}{GetBeginDST}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Get the beginning of DST for the given country in the given year (current one
|
|
|
|
by default). This function suffers from limitations described in
|
|
|
|
\helpref{DST overview}{tdatedst}.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{GetEndDST}{wxdatetimegetenddst}
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::GetCountry}\label{wxdatetimegetcountry}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static Country}{GetCountry}{\void}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Returns the current default country. The default country is used for DST
|
|
|
|
calculations, for example.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{SetCountry}{wxdatetimesetcountry}
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::GetCurrentYear}\label{wxdatetimegetcurrentyear}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static int}{GetCurrentYear}{\param{Calendar }{cal = Gregorian}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Get the current year in given calendar (only Gregorian is currently supported).
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::GetCurrentMonth}\label{wxdatetimegetcurrentmonth}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static Month}{GetCurrentMonth}{\param{Calendar }{cal = Gregorian}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Get the current month in given calendar (only Gregorian is currently supported).
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::GetCentury}\label{wxdatetimegetcentury}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static int}{GetCentury}{\param{int }{year = Inv\_Year}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Get the current century, i.e. first two digits of the year, in given calendar
|
|
|
|
(only Gregorian is currently supported).
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::GetEndDST}\label{wxdatetimegetenddst}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static wxDateTime}{GetEndDST}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Returns the end of DST for the given country in the given year (current one by
|
|
|
|
default).
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{GetBeginDST}{wxdatetimegetbegindst}
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::GetMonthName}\label{wxdatetimegetmonthname}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static wxString}{GetMonthName}{\param{Month }{month}, \param{NameFlags }{flags = Name\_Full}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Gets the full (default) or abbreviated (specify {\tt Name\_Abbr} name of the
|
|
|
|
given month.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{GetWeekDayName}{wxdatetimegetweekdayname}
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::GetNumberOfDays}\label{wxdatetimegetnumberofdays}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static wxDateTime\_t}{GetNumberOfDays}{\param{int }{year}, \param{Calendar }{cal = Gregorian}}
|
|
|
|
|
|
|
|
\func{static wxDateTime\_t}{GetNumberOfDays}{\param{Month }{month}, \param{int }{year = Inv\_Year}, \param{Calendar }{cal = Gregorian}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Returns the number of days in the given year or in the given month of the
|
|
|
|
year.
|
|
|
|
|
|
|
|
The only supported value for {\it cal} parameter is currently {\tt Gregorian}.
|
|
|
|
|
|
|
|
\pythonnote{These two methods are named {\tt GetNumberOfDaysInYear}
|
|
|
|
and {\tt GetNumberOfDaysInMonth} in wxPython.}
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::GetWeekDayName}\label{wxdatetimegetweekdayname}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static wxString}{GetWeekDayName}{\param{WeekDay }{weekday}, \param{NameFlags }{flags = Name\_Full}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Gets the full (default) or abbreviated (specify {\tt Name\_Abbr} name of the
|
|
|
|
given week day.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{GetMonthName}{wxdatetimegetmonthname}
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::IsLeapYear}\label{wxdatetimeisleapyear}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static bool}{IsLeapYear}{\param{int }{year = Inv\_Year}, \param{Calendar }{cal = Gregorian}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the {\it year} is a leap one in the specified calendar.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
This functions supports Gregorian and Julian calendars.
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::IsWestEuropeanCountry}\label{wxdatetimeiswesteuropeancountry}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static bool}{IsWestEuropeanCountry}{\param{Country }{country = Country\_Default}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
This function returns {\tt true} if the specified (or default) country is one
|
2000-07-15 15:51:35 -04:00
|
|
|
of Western European ones. It is used internally by wxDateTime to determine the
|
|
|
|
DST convention and date and time formatting rules.
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::IsDSTApplicable}\label{wxdatetimeisdstapplicable}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static bool}{IsDSTApplicable}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if DST was used n the given year (the current one by
|
2000-07-15 15:51:35 -04:00
|
|
|
default) in the given country.
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::Now}\label{wxdatetimenow}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static wxDateTime}{Now}{\void}
|
|
|
|
|
2002-06-07 16:15:28 -04:00
|
|
|
Returns the object corresponding to the current time.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
wxDateTime now = wxDateTime::Now();
|
|
|
|
printf("Current time in Paris:\t%s\n", now.Format("%c", wxDateTime::CET).c_str());
|
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
Note that this function is accurate up to second:
|
|
|
|
\helpref{wxDateTime::UNow}{wxdatetimeunow} should be used for better precision
|
2002-06-07 16:15:28 -04:00
|
|
|
(but it is less efficient and might not be available on all platforms).
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{Today}{wxdatetimetoday}
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::SetCountry}\label{wxdatetimesetcountry}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static void}{SetCountry}{\param{Country }{country}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Sets the country to use by default. This setting influences the DST
|
|
|
|
calculations, date formatting and other things.
|
|
|
|
|
|
|
|
The possible values for {\it country} parameter are enumerated in
|
|
|
|
\helpref{wxDateTime constants section}{wxdatetime}.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{GetCountry}{wxdatetimegetcountry}
|
|
|
|
|
2000-03-10 11:06:33 -05:00
|
|
|
\membersection{wxDateTime::Today}\label{wxdatetimetoday}
|
2000-03-09 20:15:17 -05:00
|
|
|
|
|
|
|
\func{static wxDateTime}{Today}{\void}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Returns the object corresponding to the midnight of the current day (i.e. the
|
|
|
|
same as \helpref{Now()}{wxdatetimenow}, but the time part is set to $0$).
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{Now}{wxdatetimenow}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::UNow}\label{wxdatetimeunow}
|
|
|
|
|
|
|
|
\func{static wxDateTime}{UNow}{\void}
|
|
|
|
|
2002-06-07 16:15:28 -04:00
|
|
|
Returns the object corresponding to the current time including the
|
2000-07-15 15:51:35 -04:00
|
|
|
milliseconds if a function to get time with such precision is available on the
|
|
|
|
current platform (supported under most Unices and Win32).
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{Now}{wxdatetimenow}
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% constructors &c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimedef}
|
|
|
|
|
|
|
|
\func{}{wxDateTime}{\void}
|
|
|
|
|
|
|
|
Default constructor. Use one of {\tt Set()} functions to initialize the object
|
|
|
|
later.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimetimet}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{wxDateTime}{\param{time\_t }{timet}}
|
|
|
|
|
|
|
|
Same as \helpref{Set}{wxdatetimewxdatetimetimet}.
|
|
|
|
|
|
|
|
\pythonnote{This constructor is named {\tt wxDateTimeFromTimeT} in wxPython.}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimetm}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{wxDateTime}{\param{const struct tm\& }{tm}}
|
|
|
|
|
|
|
|
Same as \helpref{Set}{wxdatetimewxdatetimetm}
|
|
|
|
|
|
|
|
\pythonnote{Unsupported.}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimejdn}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{wxDateTime}{\param{double }{jdn}}
|
|
|
|
|
|
|
|
Same as \helpref{Set}{wxdatetimewxdatetimejdn}
|
|
|
|
|
|
|
|
\pythonnote{This constructor is named {\tt wxDateTimeFromJDN} in wxPython.}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimetime}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{wxDateTime}{\param{wxDateTime\_t }{hour}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}}
|
|
|
|
|
|
|
|
Same as \helpref{Set}{wxdatetimewxdatetimetime}
|
|
|
|
|
|
|
|
\pythonnote{This constructor is named {\tt wxDateTimeFromHMS} in wxPython.}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimedate}
|
|
|
|
|
2002-05-08 15:51:58 -04:00
|
|
|
\func{wxDateTime\&}{wxDateTime}{\param{wxDateTime\_t }{day}, \param{Month }{month = Inv\_Month}, \param{int}{ Inv\_Year},
|
2002-05-05 05:35:44 -04:00
|
|
|
\param{wxDateTime\_t }{hour = 0}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
Same as \helpref{Set}{wxdatetimesetdate}
|
|
|
|
|
|
|
|
\pythonnote{This constructor is named {\tt wxDateTimeFromDMY} in wxPython.}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetToCurrent}\label{wxdatetimesettocurrent}
|
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
\func{wxDateTime\&}{SetToCurrent}{\void}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
Sets the date and time of to the current values. Same as assigning the result
|
|
|
|
of \helpref{Now()}{wxdatetimenow} to this object.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::Set}\label{wxdatetimesettimet}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{Set}{\param{time\_t }{timet}}
|
|
|
|
|
|
|
|
Constructs the object from {\it timet} value holding the number of seconds
|
|
|
|
since Jan 1, 1970.
|
|
|
|
|
|
|
|
\pythonnote{This method is named {\tt SetTimeT} in wxPython.}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::Set}\label{wxdatetimesettm}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{Set}{\param{const struct tm\& }{tm}}
|
|
|
|
|
2002-06-07 16:15:28 -04:00
|
|
|
Sets the date and time from the broken down representation in the standard
|
2000-07-15 15:51:35 -04:00
|
|
|
{\tt tm} structure.
|
|
|
|
|
|
|
|
\pythonnote{Unsupported.}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::Set}\label{wxdatetimesetjdn}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{Set}{\param{double }{jdn}}
|
|
|
|
|
|
|
|
Sets the date from the so-called {\it Julian Day Number}.
|
|
|
|
|
|
|
|
By definition, the Julian Day Number, usually abbreviated as JDN, of a
|
|
|
|
particular instant is the fractional number of days since 12 hours Universal
|
2002-06-07 16:15:28 -04:00
|
|
|
Coordinated Time (Greenwich mean noon) on January 1 of the year -4712 in the
|
2000-07-15 15:51:35 -04:00
|
|
|
Julian proleptic calendar.
|
|
|
|
|
|
|
|
\pythonnote{This method is named {\tt SetJDN} in wxPython.}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::Set}\label{wxdatetimesettime}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{Set}{\param{wxDateTime\_t }{hour}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}}
|
|
|
|
|
|
|
|
Sets the date to be equal to \helpref{Today}{wxdatetimetoday} and the time
|
|
|
|
from supplied parameters.
|
|
|
|
|
|
|
|
\pythonnote{This method is named {\tt SetHMS} in wxPython.}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::Set}\label{wxdatetimesetdate}
|
|
|
|
|
2002-01-13 06:35:23 -05:00
|
|
|
\func{wxDateTime\&}{Set}{\param{wxDateTime\_t }{day}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}, \param{wxDateTime\_t }{hour = 0}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
Sets the date and time from the parameters.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::ResetTime}\label{wxdatetimeresettime}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{ResetTime}{\void}
|
|
|
|
|
|
|
|
Reset time to midnight (00:00:00) without changing the date.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetYear}\label{wxdatetimesetyear}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{SetYear}{\param{int }{year}}
|
|
|
|
|
|
|
|
Sets the year without changing other date components.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetMonth}\label{wxdatetimesetmonth}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{SetMonth}{\param{Month }{month}}
|
|
|
|
|
|
|
|
Sets the month without changing other date components.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetDay}\label{wxdatetimesetday}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{SetDay}{\param{wxDateTime\_t }{day}}
|
|
|
|
|
|
|
|
Sets the day without changing other date components.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetHour}\label{wxdatetimesethour}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{SetHour}{\param{wxDateTime\_t }{hour}}
|
|
|
|
|
|
|
|
Sets the hour without changing other date components.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetMinute}\label{wxdatetimesetminute}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{SetMinute}{\param{wxDateTime\_t }{minute}}
|
|
|
|
|
|
|
|
Sets the minute without changing other date components.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetSecond}\label{wxdatetimesetsecond}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{SetSecond}{\param{wxDateTime\_t }{second}}
|
|
|
|
|
|
|
|
Sets the second without changing other date components.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetMillisecond}\label{wxdatetimesetmillisecond}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{SetMillisecond}{\param{wxDateTime\_t }{millisecond}}
|
|
|
|
|
|
|
|
Sets the millisecond without changing other date components.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::operator$=$}\label{wxdatetimeoperatoreqtimet}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{operator}{\param{time\_t }{timet}}
|
|
|
|
|
|
|
|
Same as \helpref{Set}{wxdatetimesettimet}.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::operator$=$}\label{wxdatetimeoperatoreqtm}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{operator}{\param{const struct tm\& }{tm}}
|
|
|
|
|
|
|
|
Same as \helpref{Set}{wxdatetimesettm}.
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% accessors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\membersection{wxDateTime::IsValid}\label{wxdatetimeisvalid}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsValid}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the object represents a valid time moment.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\membersection{wxDateTime::GetTm}\label{wxdatetimegettm}
|
|
|
|
|
|
|
|
\constfunc{Tm}{GetTm}{\param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns broken down representation of the date and time.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetTicks}\label{wxdatetimegetticks}
|
|
|
|
|
|
|
|
\constfunc{time\_t}{GetTicks}{\void}
|
|
|
|
|
|
|
|
Returns the number of seconds since Jan 1, 1970. An assert failure will occur
|
|
|
|
if the date is not in the range covered by {\tt time\_t} type.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetYear}\label{wxdatetimegetyear}
|
|
|
|
|
|
|
|
\constfunc{int}{GetYear}{\param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns the year in the given timezone (local one by default).
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetMonth}\label{wxdatetimegetmonth}
|
|
|
|
|
|
|
|
\constfunc{Month}{GetMonth}{\param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns the month in the given timezone (local one by default).
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetDay}\label{wxdatetimegetday}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime\_t}{GetDay}{\param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns the day in the given timezone (local one by default).
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetWeekDay}\label{wxdatetimegetweekday}
|
|
|
|
|
|
|
|
\constfunc{WeekDay}{GetWeekDay}{\param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns the week day in the given timezone (local one by default).
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetHour}\label{wxdatetimegethour}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime\_t}{GetHour}{\param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns the hour in the given timezone (local one by default).
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetMinute}\label{wxdatetimegetminute}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime\_t}{GetMinute}{\param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns the minute in the given timezone (local one by default).
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetSecond}\label{wxdatetimegetsecond}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime\_t}{GetSecond}{\param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns the seconds in the given timezone (local one by default).
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetMillisecond}\label{wxdatetimegetmillisecond}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime\_t}{GetMillisecond}{\param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns the milliseconds in the given timezone (local one by default).
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetDayOfYear}\label{wxdatetimegetdayofyear}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime\_t}{GetDayOfYear}{\param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns the day of the year (in $1\ldots366$ range) in the given timezone
|
|
|
|
(local one by default).
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetWeekOfYear}\label{wxdatetimegetweekofyear}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime\_t}{GetWeekOfYear}{\param{WeekFlags }{flags = Monday\_First}, \param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns the number of the week of the year this date is in. The first week of
|
|
|
|
the year is, according to international standards, the one containing Jan 4.
|
|
|
|
The week number is in $1\ldots53$ range ($52$ for non leap years).
|
|
|
|
|
|
|
|
The function depends on the \helpref{week start}{wxdatetime} convention
|
|
|
|
specified by the {\it flags} argument.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetWeekOfMonth}\label{wxdatetimegetweekofmonth}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime\_t}{GetWeekOfMonth}{\param{WeekFlags }{flags = Monday\_First}, \param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
Returns the ordinal number of the week in the month (in $1\ldots5$ range).
|
|
|
|
|
|
|
|
As \helpref{GetWeekOfYear}{wxdatetimegetweekofyear}, this function supports
|
|
|
|
both conventions for the week start. See the description of these
|
|
|
|
\helpref{week start}{wxdatetime} conventions.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::IsWorkDay}\label{wxdatetimeisworkday}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsWorkDay}{\param{Country }{country = Country\_Default}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} is this day is not a holiday in the given country.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\membersection{wxDateTime::IsGregorianDate}\label{wxdatetimeisgregoriandate}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsGregorianDate}{\param{GregorianAdoption }{country = Gr\_Standard}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the given date os later than the date of adoption of the
|
2000-07-15 15:51:35 -04:00
|
|
|
Gregorian calendar in the given country (and hence the Gregorian calendar
|
|
|
|
calculations make sense for it).
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%% dos date and time format %%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetFromDOS}\label{wxdatetimesetfromdos}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{Set}{\param{unsigned long }{ddt}}
|
|
|
|
|
|
|
|
Sets the date from the date and time in
|
|
|
|
\urlref{DOS}{http://developer.novell.com/ndk/doc/smscomp/index.html?page=/ndk/doc/smscomp/sms\_docs/data/hc2vlu5i.html}
|
|
|
|
format.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetAsDOS}\label{wxdatetimegetasdos}
|
|
|
|
|
|
|
|
\constfunc{unsigned long}{GetAsDOS}{\void}
|
|
|
|
|
|
|
|
Returns the date and time in
|
|
|
|
\urlref{DOS}{http://developer.novell.com/ndk/doc/smscomp/index.html?page=/ndk/doc/smscomp/sms\_docs/data/hc2vlu5i.html}
|
|
|
|
format.
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% comparison %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\membersection{wxDateTime::IsEqualTo}\label{wxdatetimeisequalto}
|
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
\constfunc{bool}{IsEqualTo}{\param{const wxDateTime\& }{datetime}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the two dates are strictly identical.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\membersection{wxDateTime::IsEarlierThan}\label{wxdatetimeisearlierthan}
|
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
\constfunc{bool}{IsEarlierThan}{\param{const wxDateTime\& }{datetime}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if this date precedes the given one.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\membersection{wxDateTime::IsLaterThan}\label{wxdatetimeislaterthan}
|
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
\constfunc{bool}{IsLaterThan}{\param{const wxDateTime\& }{datetime}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if this date is later than the given one.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\membersection{wxDateTime::IsStrictlyBetween}\label{wxdatetimeisstrictlybetween}
|
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
\constfunc{bool}{IsStrictlyBetween}{\param{const wxDateTime\& }{t1}, \param{const wxDateTime\& }{t2}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if this date lies strictly between the two others,
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{IsBetween}{wxdatetimeisbetween}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::IsBetween}\label{wxdatetimeisbetween}
|
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
\constfunc{bool}{IsBetween}{\param{const wxDateTime\& }{t1}, \param{const wxDateTime\& }{t2}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if \helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween}
|
|
|
|
is {\tt true} or if the date is equal to one of the limit values.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::IsSameDate}\label{wxdatetimeissamedate}
|
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
\constfunc{bool}{IsSameDate}{\param{const wxDateTime\& }{dt}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the date is the same without comparing the time parts.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\membersection{wxDateTime::IsSameTime}\label{wxdatetimeissametime}
|
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
\constfunc{bool}{IsSameTime}{\param{const wxDateTime\& }{dt}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the time is the same (although dates may differ).
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\membersection{wxDateTime::IsEqualUpTo}\label{wxdatetimeisequalupto}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsEqualUpTo}{\param{const wxDateTime\& }{dt}, \param{const wxTimeSpan\& }{ts}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the date is equal to another one up to the given time
|
2000-07-15 15:51:35 -04:00
|
|
|
interval, i.e. if the absolute difference between the two dates is less than
|
|
|
|
this interval.
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% arithmetics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\membersection{wxDateTime::Add}\label{wxdatetimeaddts}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime}{Add}{\param{const wxTimeSpan\& }{diff}}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{Add}{\param{const wxTimeSpan\& }{diff}}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{operator$+=$}{\param{const wxTimeSpan\& }{diff}}
|
|
|
|
|
|
|
|
Adds the given time span to this object.
|
|
|
|
|
|
|
|
\pythonnote{This method is named {\tt AddTS} in wxPython.}
|
|
|
|
|
|
|
|
|
|
|
|
\membersection{wxDateTime::Add}\label{wxdatetimeaddds}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime}{Add}{\param{const wxDateSpan\& }{diff}}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{Add}{\param{const wxDateSpan\& }{diff}}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{operator$+=$}{\param{const wxDateSpan\& }{diff}}
|
|
|
|
|
|
|
|
Adds the given date span to this object.
|
|
|
|
|
|
|
|
\pythonnote{This method is named {\tt AddDS} in wxPython.}
|
|
|
|
|
2003-04-06 14:37:06 -04:00
|
|
|
|
|
|
|
\membersection{wxDateTime::Subtract}\label{wxdatetimesubtractts}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime}{Subtract}{\param{const wxTimeSpan\& }{diff}}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{Subtract}{\param{const wxTimeSpan\& }{diff}}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{operator$-=$}{\param{const wxTimeSpan\& }{diff}}
|
|
|
|
|
|
|
|
Subtracts the given time span from this object.
|
|
|
|
|
|
|
|
\pythonnote{This method is named {\tt SubtractTS} in wxPython.}
|
|
|
|
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\membersection{wxDateTime::Subtract}\label{wxdatetimesubtractds}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime}{Subtract}{\param{const wxDateSpan\& }{diff}}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{Subtract}{\param{const wxDateSpan\& }{diff}}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{operator$-=$}{\param{const wxDateSpan\& }{diff}}
|
|
|
|
|
|
|
|
Subtracts the given date span from this object.
|
|
|
|
|
|
|
|
\pythonnote{This method is named {\tt SubtractDS} in wxPython.}
|
|
|
|
|
2003-04-06 14:37:06 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\membersection{wxDateTime::Subtract}\label{wxdatetimesubtractdt}
|
|
|
|
|
|
|
|
\constfunc{wxTimeSpan}{Subtract}{\param{const wxDateTime\& }{dt}}
|
|
|
|
|
|
|
|
Subtracts another date from this one and returns the difference between them
|
|
|
|
as wxTimeSpan.
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% parsing/formatting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\membersection{wxDateTime::ParseRfc822Date}\label{wxdatetimeparserfc822date}
|
|
|
|
|
|
|
|
\func{const wxChar *}{ParseRfc822Date}{\param{const wxChar* }{date}}
|
|
|
|
|
|
|
|
Parses the string {\it date} looking for a date formatted according to the RFC
|
|
|
|
822 in it. The exact description of this format may, of course, be found in
|
|
|
|
the RFC (section $5$), but, briefly, this is the format used in the headers of
|
|
|
|
Internet email messages and one of the most common strings expressing date in
|
|
|
|
this format may be something like {\tt "Sat, 18 Dec 1999 00:48:30 +0100"}.
|
|
|
|
|
|
|
|
Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
|
|
|
|
the character immediately following the part of the string which could be
|
|
|
|
parsed. If the entire string contains only the date in RFC 822 format,
|
|
|
|
the returned pointer will be pointing to a {\tt NUL} character.
|
|
|
|
|
2002-06-07 16:15:28 -04:00
|
|
|
This function is intentionally strict, it will return an error for any string
|
2000-07-15 15:51:35 -04:00
|
|
|
which is not RFC 822 compliant. If you need to parse date formatted in more
|
|
|
|
free ways, you should use \helpref{ParseDateTime}{wxdatetimeparsedatetime} or
|
|
|
|
\helpref{ParseDate}{wxdatetimeparsedate} instead.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::ParseFormat}\label{wxdatetimeparseformat}
|
|
|
|
|
|
|
|
\func{const wxChar *}{ParseFormat}{\param{const wxChar *}{date}, \param{const wxChar *}{format = "\%c"}, \param{const wxDateTime\& }{dateDef = wxDefaultDateTime}}
|
|
|
|
|
|
|
|
This function parses the string {\it date} according to the given
|
|
|
|
{\it format}. The system {\tt strptime(3)} function is used whenever available,
|
2003-09-11 10:22:23 -04:00
|
|
|
but even if it is not, this function is still implemented, although support
|
|
|
|
for locale-dependent format specifiers such as {\tt "\%c"}, {\tt "\%x"} or {\tt "\%X"} may
|
|
|
|
not be perfect and GNU extensions such as {\tt "\%z"} and {\tt "\%Z"} are
|
|
|
|
not implemented. This function does handle the month and weekday
|
|
|
|
names in the current locale on all platforms, however.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-09-11 10:22:23 -04:00
|
|
|
Please see the description of the ANSI C function {\tt strftime(3)} for the syntax
|
|
|
|
of the format string.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
The {\it dateDef} parameter is used to fill in the fields which could not be
|
2003-09-11 10:22:23 -04:00
|
|
|
determined from the format string. For example, if the format is {\tt "\%d"} (the
|
|
|
|
ay of the month), the month and the year are taken from {\it dateDef}. If
|
|
|
|
it is not specified, \helpref{Today}{wxdatetimetoday} is used as the
|
2000-07-15 15:51:35 -04:00
|
|
|
default date.
|
|
|
|
|
|
|
|
Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
|
|
|
|
the character which stopped the scan.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::ParseDateTime}\label{wxdatetimeparsedatetime}
|
|
|
|
|
|
|
|
\func{const wxChar *}{ParseDateTime}{\param{const wxChar *}{datetime}}
|
|
|
|
|
|
|
|
Parses the string {\it datetime} containing the date and time in free format.
|
|
|
|
This function tries as hard as it can to interpret the given string as date
|
|
|
|
and time. Unlike \helpref{ParseRfc822Date}{wxdatetimeparserfc822date}, it
|
|
|
|
will accept anything that may be accepted and will only reject strings which
|
|
|
|
can not be parsed in any way at all.
|
|
|
|
|
|
|
|
Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
|
2003-09-11 10:22:23 -04:00
|
|
|
the character which stopped the scan. This method is currently not
|
|
|
|
implemented, so always returns NULL.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\membersection{wxDateTime::ParseDate}\label{wxdatetimeparsedate}
|
|
|
|
|
|
|
|
\func{const wxChar *}{ParseDate}{\param{const wxChar *}{date}}
|
|
|
|
|
|
|
|
This function is like \helpref{ParseDateTime}{wxdatetimeparsedatetime}, but it
|
2001-01-02 02:59:43 -05:00
|
|
|
only allows the date to be specified. It is thus less flexible then
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{ParseDateTime}{wxdatetimeparsedatetime}, but also has less chances to
|
|
|
|
misinterpret the user input.
|
|
|
|
|
|
|
|
Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
|
|
|
|
the character which stopped the scan.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::ParseTime}\label{wxdatetimeparsetime}
|
|
|
|
|
|
|
|
\func{const wxChar *}{ParseTime}{\param{const wxChar *}{time}}
|
|
|
|
|
|
|
|
This functions is like \helpref{ParseDateTime}{wxdatetimeparsedatetime}, but
|
|
|
|
only allows the time to be specified in the input string.
|
|
|
|
|
|
|
|
Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
|
|
|
|
the character which stopped the scan.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::Format}\label{wxdatetimeformat}
|
|
|
|
|
|
|
|
\constfunc{wxString }{Format}{\param{const wxChar *}{format = "\%c"}, \param{const TimeZone\& }{tz = Local}}
|
|
|
|
|
|
|
|
This function does the same as the standard ANSI C {\tt strftime(3)} function.
|
|
|
|
Please see its description for the meaning of {\it format} parameter.
|
|
|
|
|
|
|
|
It also accepts a few wxWindows-specific extensions: you can optionally specify
|
|
|
|
the width of the field to follow using {\tt printf(3)}-like syntax and the
|
2002-06-07 16:15:28 -04:00
|
|
|
format specification {\tt \%l} can be used to get the number of milliseconds.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{ParseFormat}{wxdatetimeparseformat}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::FormatDate}\label{wxdatetimeformatdate}
|
|
|
|
|
|
|
|
\constfunc{wxString }{FormatDate}{\void}
|
|
|
|
|
|
|
|
Identical to calling \helpref{Format()}{wxdatetimeformat} with {\tt "\%x"}
|
|
|
|
argument (which means `preferred date representation for the current locale').
|
|
|
|
|
|
|
|
\membersection{wxDateTime::FormatTime}\label{wxdatetimeformattime}
|
|
|
|
|
|
|
|
\constfunc{wxString }{FormatTime}{\void}
|
|
|
|
|
|
|
|
Identical to calling \helpref{Format()}{wxdatetimeformat} with {\tt "\%X"}
|
|
|
|
argument (which means `preferred time representation for the current locale').
|
|
|
|
|
|
|
|
\membersection{wxDateTime::FormatISODate}\label{wxdatetimeformatisodate}
|
|
|
|
|
|
|
|
\constfunc{wxString }{FormatISODate}{\void}
|
|
|
|
|
|
|
|
This function returns the date representation in the ISO 8601 format
|
|
|
|
(YYYY-MM-DD).
|
|
|
|
|
|
|
|
\membersection{wxDateTime::FormatISOTime}\label{wxdatetimeformatisotime}
|
|
|
|
|
|
|
|
\constfunc{wxString }{FormatISOTime}{\void}
|
|
|
|
|
|
|
|
This function returns the time representation in the ISO 8601 format
|
|
|
|
(HH:MM:SS).
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% calendar calculations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetToWeekDayInSameWeek}\label{wxdatetimesettoweekdayinsameweek}
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
\func{wxDateTime\&}{SetToWeekDayInSameWeek}{\param{WeekDay }{weekday}, \param{WeekFlags}{flags = {\tt Monday\_First}}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
Adjusts the date so that it will still lie in the same week as before, but its
|
|
|
|
week day will be the given one.
|
|
|
|
|
|
|
|
Returns the reference to the modified object itself.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetWeekDayInSameWeek}\label{wxdatetimegetweekdayinsameweek}
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
\constfunc{wxDateTime}{GetWeekDayInSameWeek}{\param{WeekDay }{weekday}, \param{WeekFlags}{flags = {\tt Monday\_First}}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
Returns the copy of this object to which
|
2000-07-15 15:51:35 -04:00
|
|
|
\helpref{SetToWeekDayInSameWeek}{wxdatetimesettoweekdayinsameweek} was
|
|
|
|
applied.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetToNextWeekDay}\label{wxdatetimesettonextweekday}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{SetToNextWeekDay}{\param{WeekDay }{weekday}}
|
|
|
|
|
|
|
|
Sets the date so that it will be the first {\it weekday} following the current
|
|
|
|
date.
|
|
|
|
|
|
|
|
Returns the reference to the modified object itself.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetNextWeekDay}\label{wxdatetimegetnextweekday}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime}{GetNextWeekDay}{\param{WeekDay }{weekday}}
|
|
|
|
|
|
|
|
Returns the copy of this object to which
|
|
|
|
\helpref{SetToNextWeekDay}{wxdatetimesettonextweekday} was applied.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetToPrevWeekDay}\label{wxdatetimesettoprevweekday}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{SetToPrevWeekDay}{\param{WeekDay }{weekday}}
|
|
|
|
|
|
|
|
Sets the date so that it will be the last {\it weekday} before the current
|
|
|
|
date.
|
|
|
|
|
|
|
|
Returns the reference to the modified object itself.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetPrevWeekDay}\label{wxdatetimegetprevweekday}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime}{GetPrevWeekDay}{\param{WeekDay }{weekday}}
|
|
|
|
|
|
|
|
Returns the copy of this object to which
|
|
|
|
\helpref{SetToPrevWeekDay}{wxdatetimesettoprevweekday} was applied.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetToWeekDay}\label{wxdatetimesettoweekday}
|
|
|
|
|
|
|
|
\func{bool}{SetToWeekDay}{\param{WeekDay }{weekday}, \param{int }{n = 1}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
|
|
|
|
|
|
|
|
Sets the date to the {\it n}-th {\it weekday} in the given month of the given
|
|
|
|
year (the current month and year are used by default). The parameter {\it n}
|
2002-06-07 16:15:28 -04:00
|
|
|
may be either positive (counting from the beginning of the month) or negative
|
2000-07-15 15:51:35 -04:00
|
|
|
(counting from the end of it).
|
|
|
|
|
|
|
|
For example, {\tt SetToWeekDay(2, wxDateTime::Wed)} will set the date to the
|
|
|
|
second Wednesday in the current month and
|
2002-08-22 16:14:47 -04:00
|
|
|
{\tt SetToWeekDay(-1, wxDateTime::Sun)} -- to the last Sunday in it.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the date was modified successfully, {\tt false}
|
2000-07-15 15:51:35 -04:00
|
|
|
otherwise meaning that the specified date doesn't exist.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetWeekDay}\label{wxdatetimegetweekday2}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime}{GetWeekDay}{\param{WeekDay }{weekday}, \param{int }{n = 1}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
|
|
|
|
|
|
|
|
Returns the copy of this object to which
|
|
|
|
\helpref{SetToWeekDay}{wxdatetimesettoweekday} was applied.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetToLastWeekDay}\label{wxdatetimesettolastweekday}
|
|
|
|
|
|
|
|
\func{bool}{SetToLastWeekDay}{\param{WeekDay }{weekday}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
|
|
|
|
|
|
|
|
The effect of calling this function is the same as of calling
|
|
|
|
{\tt SetToWeekDay(-1, weekday, month, year)}. The date will be set to the last
|
|
|
|
{\it weekday} in the given month and year (the current ones by default).
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Always returns {\tt true}.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\membersection{wxDateTime::GetLastWeekDay}\label{wxdatetimegetlastweekday}
|
|
|
|
|
|
|
|
\func{wxDateTime}{GetLastWeekDay}{\param{WeekDay }{weekday}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
|
|
|
|
|
|
|
|
Returns the copy of this object to which
|
|
|
|
\helpref{SetToLastWeekDay}{wxdatetimesettolastweekday} was applied.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetToTheWeek}\label{wxdatetimesettotheweek}
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
\func{bool}{SetToTheWeek}{\param{wxDateTime\_t }{numWeek}, \param{WeekDay }{weekday = Mon}, \param{WeekFlags}{flags = {\tt Monday\_First}}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
Set the date to the given {\it weekday} in the week with given number
|
2003-01-17 19:16:34 -05:00
|
|
|
{\it numWeek}. The number should be in range $1\ldots53$ and {\tt false} will
|
|
|
|
be returned if the specified date doesn't exist. {\tt true} is returned if the
|
2000-07-15 15:51:35 -04:00
|
|
|
date was changed successfully.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetWeek}\label{wxdatetimegetweek}
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
\constfunc{wxDateTime}{GetWeek}{\param{wxDateTime\_t }{numWeek}, \param{WeekDay }{weekday = Mon}, \param{WeekFlags}{flags = {\tt Monday\_First}}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
Returns the copy of this object to which
|
|
|
|
\helpref{SetToTheWeek}{wxdatetimesettotheweek} was applied.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetToLastMonthDay}\label{wxdatetimesettolastmonthday}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{SetToLastMonthDay}{\param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
|
|
|
|
|
|
|
|
Sets the date to the last day in the specified month (the current one by
|
|
|
|
default).
|
|
|
|
|
|
|
|
Returns the reference to the modified object itself.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetLastMonthDay}\label{wxdatetimegetlastmonthday}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime}{GetLastMonthDay}{\param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
|
|
|
|
|
|
|
|
Returns the copy of this object to which
|
|
|
|
\helpref{SetToLastMonthDay}{wxdatetimesettolastmonthday} was applied.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::SetToYearDay}\label{wxdatetimesettoyearday}
|
|
|
|
|
|
|
|
\func{wxDateTime\&}{SetToYearDay}{\param{wxDateTime\_t }{yday}}
|
|
|
|
|
|
|
|
Sets the date to the day number {\it yday} in the same year (i.e., unlike the
|
|
|
|
other functions, this one does not use the current year). The day number
|
|
|
|
should be in the range $1\ldots366$ for the leap years and $1\ldots365$ for
|
|
|
|
the other ones.
|
|
|
|
|
|
|
|
Returns the reference to the modified object itself.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetYearDay}\label{wxdatetimegetyearday}
|
|
|
|
|
|
|
|
\constfunc{wxDateTime}{GetYearDay}{\param{wxDateTime\_t }{yday}}
|
|
|
|
|
|
|
|
Returns the copy of this object to which
|
|
|
|
\helpref{SetToYearDay}{wxdatetimesettoyearday} was applied.
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% astronomical functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetJulianDayNumber}\label{wxdatetimegetjuliandaynumber}
|
|
|
|
|
|
|
|
\constfunc{double}{GetJulianDayNumber}{\void}
|
|
|
|
|
|
|
|
Returns the \helpref{JDN}{wxdatetimesetjdn} corresponding to this date. Beware
|
|
|
|
of rounding errors!
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{GetModifiedJulianDayNumber}{wxdatetimegetmodifiedjuliandaynumber}
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetJDN}\label{wxdatetimegetjdn}
|
|
|
|
|
|
|
|
\constfunc{double}{GetJDN}{\void}
|
|
|
|
|
|
|
|
Synonym for \helpref{GetJulianDayNumber}{wxdatetimegetjuliandaynumber}.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetModifiedJulianDayNumber}\label{wxdatetimegetmodifiedjuliandaynumber}
|
|
|
|
|
|
|
|
\constfunc{double}{GetModifiedJulianDayNumber}{\void}
|
|
|
|
|
|
|
|
Returns the {\it Modified Julian Day Number} (MJD) which is, by definition,
|
|
|
|
equal to $JDN - 2400000.5$. The MJDs are simpler to work with as the integral
|
|
|
|
MJDs correspond to midnights of the dates in the Gregorian calendar and not th
|
|
|
|
noons like JDN. The MJD $0$ is Nov 17, 1858.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetMJD}\label{wxdatetimegetmjd}
|
|
|
|
|
|
|
|
\constfunc{double}{GetMJD}{\void}
|
|
|
|
|
|
|
|
Synonym for \helpref{GetModifiedJulianDayNumber}{wxdatetimegetmodifiedjuliandaynumber}.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::GetRataDie}\label{wxdatetimegetratadie}
|
|
|
|
|
|
|
|
\constfunc{double}{GetRataDie}{\void}
|
|
|
|
|
|
|
|
Return the {\it Rata Die number} of this date.
|
|
|
|
|
|
|
|
By definition, the Rata Die number is a date specified as the number of days
|
|
|
|
relative to a base date of December 31 of the year 0. Thus January 1 of the
|
|
|
|
year 1 is Rata Die day 1.
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% timezone and DST %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\membersection{wxDateTime::ToTimezone}\label{wxdatetimetotimezone}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\constfunc{wxDateTime}{ToTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Transform the date to the given time zone. If {\it noDST} is {\tt true}, no
|
2000-07-15 15:51:35 -04:00
|
|
|
DST adjustments will be made.
|
|
|
|
|
|
|
|
Returns the date in the new time zone.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::MakeTimezone}\label{wxdatetimemaketimezone}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\func{wxDateTime\&}{MakeTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
Modifies the object in place to represent the date in another time zone. If
|
2003-01-17 19:16:34 -05:00
|
|
|
{\it noDST} is {\tt true}, no DST adjustments will be made.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\membersection{wxDateTime::ToGMT}\label{wxdatetimetogmt}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\constfunc{wxDateTime}{ToGMT}{\param{bool }{noDST = false}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
This is the same as calling \helpref{ToTimezone}{wxdatetimetotimezone} with
|
|
|
|
the argument {\tt GMT0}.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::MakeGMT}\label{wxdatetimemakegmt}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\func{wxDateTime\&}{MakeGMT}{\param{bool }{noDST = false}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
This is the same as calling \helpref{MakeTimezone}{wxdatetimemaketimezone} with
|
|
|
|
the argument {\tt GMT0}.
|
|
|
|
|
|
|
|
\membersection{wxDateTime::IsDST}\label{wxdatetimeisdst}
|
|
|
|
|
|
|
|
\constfunc{int}{IsDST}{\param{Country }{country = Country\_Default}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the DST is applied for this date in the given country.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{GetBeginDST}{wxdatetimegetbegindst} and
|
|
|
|
\helpref{GetEndDST}{wxdatetimegetenddst}
|
|
|
|
|
|
|
|
\section{\class{wxDateTimeHolidayAuthority}}\label{wxdatetimeholidayauthority}
|
|
|
|
|
|
|
|
TODO
|
|
|
|
|
|
|
|
\section{\class{wxDateTimeWorkDays}}\label{wxdatetimeworkdays}
|
|
|
|
|
|
|
|
TODO
|
|
|
|
|