X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2edb0bdef6238c8c246b6978bc14828b7033d931..235fb242f665ea0bf3e1bff3d5344f4d621ab75e:/docs/latex/wx/datetime.tex diff --git a/docs/latex/wx/datetime.tex b/docs/latex/wx/datetime.tex index 1b8e204cf4..dd0a450766 100644 --- a/docs/latex/wx/datetime.tex +++ b/docs/latex/wx/datetime.tex @@ -43,7 +43,7 @@ Time zone symbolic names: 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 @@ -77,10 +77,14 @@ Time zone symbolic names: // Australia A_WST = GMT8, // Western Standard Time - A_CST = GMT12 + 1, // Central Standard Time (+9.5) + A_CST = GMT13 + 1, // Central Standard Time (+9.5) A_EST = GMT10, // Eastern Standard Time A_ESST = GMT11, // Eastern Summer Time + // New Zealand + NZST = GMT12, // Standard Time + NZDT = GMT13, // Daylight Saving Time + // Universal Coordinated Time = the new and politically correct name // for GMT UTC = GMT0 @@ -97,7 +101,7 @@ Likewise, Sun, Mon, Tue, Wed, Thu, Fri, Sat, and Inv\_WeekDay are the values in Finally, Inv\_Year is defined to be an invalid value for year parameter. \helpref{GetMonthName()}{wxdatetimegetmonthname} and -\helpref{GetWeekDayName}{wxdatetimegetweekdayname} functions use the followign +\helpref{GetWeekDayName}{wxdatetimegetweekdayname} functions use the following flags: \begin{verbatim} @@ -121,7 +125,7 @@ parameters is one of the following values: \end{verbatim} Date calculations often depend on the country and wxDateTime allows to set the -country whose conventions should be used using +country whose conventions should be used using \helpref{SetCountry}{wxdatetimesetcountry}. It takes one of the following values as parameter: @@ -145,10 +149,10 @@ values as parameter: }; \end{verbatim} -Different parst of the world use different conventions for the week start. -In some countries, the week starts on Sunday, while in others - on Monday. +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. The ISO standard doesn't address this issue, so we support both conventions in -the functions whose result depends on it (\helpref{GetWeekOfYear}{wxdatetimegetweekofyear} and +the functions whose result depends on it (\helpref{GetWeekOfYear}{wxdatetimegetweekofyear} and \helpref{GetWeekOfMonth}{wxdatetimegetweekofmonth}). The desired behvaiour may be specified by giving one of the following @@ -180,7 +184,8 @@ No base class \latexignore{\rtfignore{\wxheading{Function groups}}} -\membersection{Static functions} + +\membersection{Static functions}\label{datetimestaticfunctions} For convenience, all static functions are collected here. These functions either set or return the static variables of wxDateSpan (the country), return @@ -191,7 +196,7 @@ 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. -\pythonnote{These methods are standalone functions named +\pythonnote{These methods are standalone functions named {\tt wxDateTime\_} in wxPython.} \helpref{SetCountry}{wxdatetimesetcountry}\\ @@ -201,7 +206,7 @@ supported. Future versions will support other calendars. \helpref{ConvertYearToBC}{wxdatetimeconvertyeartobc}\\ \helpref{GetCurrentMonth}{wxdatetimegetcurrentmonth}\\ \helpref{IsLeapYear}{wxdatetimeisleapyear}\\ -\helpref{GetCentury}{wxdatetimegetcentury}\\ +\helpref{GetCentury}{wxdatetimegetcenturystatic}\\ \helpref{GetNumberOfDays}{wxdatetimegetnumberofdays}\\ \helpref{GetNumberOfDays}{wxdatetimegetnumberofdays}\\ \helpref{GetMonthName}{wxdatetimegetmonthname}\\ @@ -214,7 +219,8 @@ supported. Future versions will support other calendars. \helpref{UNow}{wxdatetimeunow}\\ \helpref{Today}{wxdatetimetoday} -\membersection{Constructors, assignment operators and setters} + +\membersection{Constructors, assignment operators and setters}\label{datetimeconstructors} Constructors and various {\tt Set()} methods are collected here. If you construct a date object from separate values for day, month and year, you @@ -235,6 +241,7 @@ values were correct as constructors can not return an error code. \helpref{Set(double jdn)}{wxdatetimesetjdn}\\ \helpref{Set(h, m, s, ms)}{wxdatetimesettime}\\ \helpref{Set(day, mon, year, h, m, s, ms)}{wxdatetimesetdate}\\ +\helpref{SetFromDOS(unsigned long ddt)}{wxdatetimesetfromdos}\\ \helpref{ResetTime}{wxdatetimeresettime}\\ \helpref{SetYear}{wxdatetimesetyear}\\ \helpref{SetMonth}{wxdatetimesetmonth}\\ @@ -244,23 +251,24 @@ values were correct as constructors can not return an error code. \helpref{SetSecond}{wxdatetimesetsecond}\\ \helpref{SetMillisecond}{wxdatetimesetmillisecond}\\ \helpref{operator$=$(time\_t)}{wxdatetimeoperatoreqtimet}\\ -\helpref{operator$=$(struct tm)}{wxdatetimeoperatoreqtm} -%\helpref{operator$=$(struct Tm)}{wxdatetimeoperatortm2} +\helpref{operator$=$(struct tm)}{wxdatetimeoperatoreqtm}\rtfsp + -\membersection{Accessors} +\membersection{Accessors}\label{datetimeaccessors} Here are the trivial accessors. Other functions, which might have to perform -some more complicated calculations to find the answer are under the -\helpref{Calendar calculations}{wxdatetimecalculations} section. +some more complicated calculations to find the answer are under the +\helpref{Calendar calculations}{datetimecalculations} section. \helpref{IsValid}{wxdatetimeisvalid}\\ \helpref{GetTicks}{wxdatetimegetticks}\\ +\helpref{GetCentury}{wxdatetimegetcentury}\\ \helpref{GetYear}{wxdatetimegetyear}\\ \helpref{GetMonth}{wxdatetimegetmonth}\\ \helpref{GetDay}{wxdatetimegetday}\\ \helpref{GetWeekDay}{wxdatetimegetweekday}\\ \helpref{GetHour}{wxdatetimegethour}\\ -\helpref{GeTMinute}{wxdatetimegetminute}\\ +\helpref{GetMinute}{wxdatetimegetminute}\\ \helpref{GetSecond}{wxdatetimegetsecond}\\ \helpref{GetMillisecond}{wxdatetimegetmillisecond}\\ \helpref{GetDayOfYear}{wxdatetimegetdayofyear}\\ @@ -268,9 +276,11 @@ some more complicated calculations to find the answer are under the \helpref{GetWeekOfMonth}{wxdatetimegetweekofmonth}\\ \helpref{GetYearDay}{wxdatetimegetyearday}\\ \helpref{IsWorkDay}{wxdatetimeisworkday}\\ -\helpref{IsGregorianDate}{wxdatetimeisgregoriandate} +\helpref{IsGregorianDate}{wxdatetimeisgregoriandate}\\ +\helpref{GetAsDOS}{wxdatetimegetasdos} -\membersection{Date comparison} + +\membersection{Date comparison}\label{datecomparison} There are several function to allow date comparison. To supplement them, a few global operators $>$, $<$ etc taking wxDateTime are defined. @@ -284,7 +294,8 @@ global operators $>$, $<$ etc taking wxDateTime are defined. \helpref{IsSameTime}{wxdatetimeissametime}\\ \helpref{IsEqualUpTo}{wxdatetimeisequalupto} -\membersection{Date arithmetics} + +\membersection{Date arithmetics}\label{datearithmetics} These functions carry out \helpref{arithmetics}{tdatearithm} on the wxDateTime objects. As explained in the overview, either wxTimeSpan or wxDateSpan may be @@ -292,7 +303,7 @@ 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 +version. The first one returns a new object 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. @@ -307,9 +318,10 @@ defined to be equivalent to the second forms of these functions. \helpref{oparator$-=$(wxTimeSpan)}{wxdatetimesubtractts}\\ \helpref{oparator$-=$(wxDateSpan)}{wxdatetimesubtractds} -\membersection{Parsing and formatting dates} -These functions perform convert wxDateTime obejcts to and from text. The +\membersection{Parsing and formatting dates}\label{datetimeparsing} + +These functions convert wxDateTime objects to and from text. The conversions to text are mostly trivial: you can either do it using the default date and time representations for the current locale ( \helpref{FormatDate}{wxdatetimeformatdate} and @@ -320,23 +332,24 @@ representation defined by ISO 8601 ( at all and using \helpref{Format}{wxdatetimeformat} directly. The conversions from text are more interesting, as there are much more -possibilities to care about. The simples cases can be taken care of with +possibilities to care about. The simplest cases can be taken care of with \helpref{ParseFormat}{wxdatetimeparseformat} which can parse any date in the given (rigid) format. \helpref{ParseRfc822Date}{wxdatetimeparserfc822date} is -another function for parsing dates in predefined format - the one of RFC 822 +another function for parsing dates in predefined format -- the one of RFC 822 which (still...) defines the format of email messages on the Internet. This format can not be described with {\tt strptime(3)}-like format strings used by \helpref{Format}{wxdatetimeformat}, hence the need for a separate function. -But the most interesting functions are -\helpref{ParseDateTime}{wxdatetimeparsedatetime} and -\helpref{ParseDate}{wxdatetimeparsedate} and -\helpref{ParseTime}{wxdatetimeparsetime}. 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"}, {\tt "next Sunday"}. +But the most interesting functions are +\helpref{ParseTime}{wxdatetimeparsetime}, +\helpref{ParseDate}{wxdatetimeparsedate} and +\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"}. \helpref{ParseRfc822Date}{wxdatetimeparserfc822date}\\ \helpref{ParseFormat}{wxdatetimeparseformat}\\ @@ -349,14 +362,15 @@ strings such as {\tt "tomorrow"}, {\tt "March first"}, {\tt "next Sunday"}. \helpref{FormatISODate}{wxdatetimeformatisodate}\\ \helpref{FormatISOTime}{wxdatetimeformatisotime} -\membersection{Calendar calculations}\label{wxdatetimecalculations} + +\membersection{Calendar calculations}\label{datetimecalculations} 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 -wxDateTime - they only work with the date part of it. +wxDateTime -- they only work with the date part of it. \helpref{SetToWeekDayInSameWeek}{wxdatetimesettoweekdayinsameweek}\\ \helpref{GetWeekDayInSameWeek}{wxdatetimegetweekdayinsameweek}\\ @@ -368,14 +382,14 @@ wxDateTime - they only work with the date part of it. \helpref{GetWeekDay}{wxdatetimegetweekday2}\\ \helpref{SetToLastWeekDay}{wxdatetimesettolastweekday}\\ \helpref{GetLastWeekDay}{wxdatetimegetlastweekday}\\ -\helpref{SetToTheWeek}{wxdatetimesettotheweek}\\ -\helpref{GetWeek}{wxdatetimegetweek}\\ +\helpref{SetToWeekOfYear}{wxdatetimesettoweekofyear}\\ \helpref{SetToLastMonthDay}{wxdatetimesettolastmonthday}\\ \helpref{GetLastMonthDay}{wxdatetimegetlastmonthday}\\ \helpref{SetToYearDay}{wxdatetimesettoyearday}\\ \helpref{GetYearDay}{wxdatetimegetyearday} -\membersection{Astronomical/historical functions} + +\membersection{Astronomical/historical functions}\label{astronomyhistoryfunctions} Some degree of support for the date units used in astronomy and/or history is provided. You can construct a wxDateTime object from a @@ -391,15 +405,18 @@ provided. You can construct a wxDateTime object from a \helpref{GetMJD}{wxdatetimegetmjd}\\ \helpref{GetRataDie}{wxdatetimegetratadie} -\membersection{Time zone and DST support} + +\membersection{Time zone and DST support}\label{datetimedstzone} Please see the \helpref{time zone overview}{tdatetimezones} for more -information about time zones. ormally, these functions should be rarely used. +information about time zones. Normally, these functions should be rarely used. +\helpref{FromTimezone}{wxdatetimefromtimezone}\\ \helpref{ToTimezone}{wxdatetimetotimezone}\\ \helpref{MakeTimezone}{wxdatetimemaketimezone}\\ -\helpref{ToGMT}{wxdatetimetogmt}\\ -\helpref{MakeGMT}{wxdatetimemakegmt}\\ +\helpref{MakeFromTimezone}{wxdatetimemakefromtimezone}\\ +\helpref{ToUTC}{wxdatetimetoutc}\\ +\helpref{MakeUTC}{wxdatetimemakeutc}\\ \helpref{GetBeginDST}{wxdatetimegetbegindst}\\ \helpref{GetEndDST}{wxdatetimegetenddst}\\ \helpref{IsDST}{wxdatetimeisdst} @@ -412,6 +429,7 @@ information about time zones. ormally, these functions should be rarely used. %%%%%%%%%%%%%%%%%%%%%%%%%%% static functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \membersection{wxDateTime::ConvertYearToBC}\label{wxdatetimeconvertyeartobc} \func{static int}{ConvertYearToBC}{\param{int }{year}} @@ -429,6 +447,7 @@ This function should be used like this: printf("The year is %d%s", wxDateTime::ConvertYearToBC(y), y > 0 ? "AD" : "BC"); \end{verbatim} + \membersection{wxDateTime::GetAmPmStrings}\label{wxdatetimegetampmstrings} \func{static void}{GetAmPmStrings}{\param{wxString *}{am}, \param{wxString *}{pm}} @@ -437,6 +456,7 @@ 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. + \membersection{wxDateTime::GetBeginDST}\label{wxdatetimegetbegindst} \func{static wxDateTime}{GetBeginDST}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}} @@ -449,6 +469,7 @@ by default). This function suffers from limitations described in \helpref{GetEndDST}{wxdatetimegetenddst} + \membersection{wxDateTime::GetCountry}\label{wxdatetimegetcountry} \func{static Country}{GetCountry}{\void} @@ -460,25 +481,29 @@ calculations, for example. \helpref{SetCountry}{wxdatetimesetcountry} + \membersection{wxDateTime::GetCurrentYear}\label{wxdatetimegetcurrentyear} \func{static int}{GetCurrentYear}{\param{Calendar }{cal = Gregorian}} Get the current year in given calendar (only Gregorian is currently supported). + \membersection{wxDateTime::GetCurrentMonth}\label{wxdatetimegetcurrentmonth} \func{static Month}{GetCurrentMonth}{\param{Calendar }{cal = Gregorian}} Get the current month in given calendar (only Gregorian is currently supported). -\membersection{wxDateTime::GetCentury}\label{wxdatetimegetcentury} -\func{static int}{GetCentury}{\param{int }{year = Inv\_Year}} +\membersection{wxDateTime::GetCentury}\label{wxdatetimegetcenturystatic} + +\func{static int}{GetCentury}{\param{int }{year}} Get the current century, i.e. first two digits of the year, in given calendar (only Gregorian is currently supported). + \membersection{wxDateTime::GetEndDST}\label{wxdatetimegetenddst} \func{static wxDateTime}{GetEndDST}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}} @@ -490,6 +515,7 @@ default). \helpref{GetBeginDST}{wxdatetimegetbegindst} + \membersection{wxDateTime::GetMonthName}\label{wxdatetimegetmonthname} \func{static wxString}{GetMonthName}{\param{Month }{month}, \param{NameFlags }{flags = Name\_Full}} @@ -501,6 +527,7 @@ given month. \helpref{GetWeekDayName}{wxdatetimegetweekdayname} + \membersection{wxDateTime::GetNumberOfDays}\label{wxdatetimegetnumberofdays} \func{static wxDateTime\_t}{GetNumberOfDays}{\param{int }{year}, \param{Calendar }{cal = Gregorian}} @@ -515,6 +542,32 @@ 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.} + +\membersection{wxDateTime::GetTimeNow}\label{wxdatetimegettimenow} + +\func{static time\_t}{GetTimeNow}{\void} + +Returns the current time. + + +\membersection{wxDateTime::GetTmNow}\label{wxdatetimegettmnow} + +\func{static struct tm *}{GetTmNow}{\param{struct tm *}{tm}} + +Returns the current time broken down, uses the buffer whose adress is +passed to the function via {\it tm} to store the result. + +\membersection{wxDateTime::GetTmNow} + +\func{static struct tm *}{GetTmNow}{\void} + +Returns the current time broken down. Note that this function returns a +pointer to a static buffer that's reused by calls to this function and +certain C library functions (e.g. localtime). If there is any chance your +code might be used in a multi-threaded application, you really should use +the flavour of function \helpref{wxDateTime::GetTmNow}{wxdatetimegettmnow} +taking a parameter. + \membersection{wxDateTime::GetWeekDayName}\label{wxdatetimegetweekdayname} \func{static wxString}{GetWeekDayName}{\param{WeekDay }{weekday}, \param{NameFlags }{flags = Name\_Full}} @@ -526,29 +579,33 @@ given week day. \helpref{GetMonthName}{wxdatetimegetmonthname} + \membersection{wxDateTime::IsLeapYear}\label{wxdatetimeisleapyear} \func{static bool}{IsLeapYear}{\param{int }{year = Inv\_Year}, \param{Calendar }{cal = Gregorian}} -Returns {\tt TRUE} if the {\it year} is a leap one in the specified calendar. +Returns {\tt true} if the {\it year} is a leap one in the specified calendar. This functions supports Gregorian and Julian calendars. + \membersection{wxDateTime::IsWestEuropeanCountry}\label{wxdatetimeiswesteuropeancountry} \func{static bool}{IsWestEuropeanCountry}{\param{Country }{country = Country\_Default}} -This function returns {\tt TRUE} if the specified (or default) country is one +This function returns {\tt true} if the specified (or default) country is one of Western European ones. It is used internally by wxDateTime to determine the DST convention and date and time formatting rules. + \membersection{wxDateTime::IsDSTApplicable}\label{wxdatetimeisdstapplicable} \func{static bool}{IsDSTApplicable}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}} -Returns {\tt TRUE} if DST was used n the given year (the current one by +Returns {\tt true} if DST was used n the given year (the current one by default) in the given country. + \membersection{wxDateTime::Now}\label{wxdatetimenow} \func{static wxDateTime}{Now}{\void} @@ -562,7 +619,7 @@ Example: 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: +Note that this function is accurate up to second: \helpref{wxDateTime::UNow}{wxdatetimeunow} should be used for better precision (but it is less efficient and might not be available on all platforms). @@ -570,6 +627,7 @@ Note that this function is accurate up to second: \helpref{Today}{wxdatetimetoday} + \membersection{wxDateTime::SetCountry}\label{wxdatetimesetcountry} \func{static void}{SetCountry}{\param{Country }{country}} @@ -584,6 +642,7 @@ The possible values for {\it country} parameter are enumerated in \helpref{GetCountry}{wxdatetimegetcountry} + \membersection{wxDateTime::Today}\label{wxdatetimetoday} \func{static wxDateTime}{Today}{\void} @@ -595,6 +654,7 @@ same as \helpref{Now()}{wxdatetimenow}, but the time part is set to $0$). \helpref{Now}{wxdatetimenow} + \membersection{wxDateTime::UNow}\label{wxdatetimeunow} \func{static wxDateTime}{UNow}{\void} @@ -609,6 +669,7 @@ current platform (supported under most Unices and Win32). %%%%%%%%%%%%%%%%%%%%%%%%%%% constructors &c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimedef} \func{}{wxDateTime}{\void} @@ -616,6 +677,7 @@ current platform (supported under most Unices and Win32). 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}} @@ -624,6 +686,7 @@ 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}} @@ -632,6 +695,7 @@ Same as \helpref{Set}{wxdatetimewxdatetimetm} \pythonnote{Unsupported.} + \membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimejdn} \func{wxDateTime\&}{wxDateTime}{\param{double }{jdn}} @@ -640,6 +704,7 @@ 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}} @@ -648,15 +713,17 @@ Same as \helpref{Set}{wxdatetimewxdatetimetime} \pythonnote{This constructor is named {\tt wxDateTimeFromHMS} in wxPython.} + \membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimedate} -\func{wxDateTime\&}{wxDateTime}{\param{wxDateTime\_t }{day}, \param{Month }{month = Inv\_Month}, \param{int}{ Inv\_Year}, +\func{wxDateTime\&}{wxDateTime}{\param{wxDateTime\_t }{day}, \param{Month }{month = Inv\_Month}, \param{int}{ Inv\_Year}, \param{wxDateTime\_t }{hour = 0}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}} Same as \helpref{Set}{wxdatetimesetdate} \pythonnote{This constructor is named {\tt wxDateTimeFromDMY} in wxPython.} + \membersection{wxDateTime::SetToCurrent}\label{wxdatetimesettocurrent} \func{wxDateTime\&}{SetToCurrent}{\void} @@ -664,6 +731,7 @@ Same as \helpref{Set}{wxdatetimesetdate} 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}} @@ -673,6 +741,7 @@ 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}} @@ -682,6 +751,7 @@ Sets the date and time from the broken down representation in the standard \pythonnote{Unsupported.} + \membersection{wxDateTime::Set}\label{wxdatetimesetjdn} \func{wxDateTime\&}{Set}{\param{double }{jdn}} @@ -695,6 +765,7 @@ 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}} @@ -704,66 +775,77 @@ from supplied parameters. \pythonnote{This method is named {\tt SetHMS} in wxPython.} + \membersection{wxDateTime::Set}\label{wxdatetimesetdate} \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}} 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}} @@ -772,11 +854,27 @@ Same as \helpref{Set}{wxdatetimesettm}. %%%%%%%%%%%%%%%%%%%%%%%%%%% accessors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \membersection{wxDateTime::IsValid}\label{wxdatetimeisvalid} \constfunc{bool}{IsValid}{\void} -Returns {\tt TRUE} if the object represents a valid time moment. +Returns {\tt true} if the object represents a valid time moment. + + +\membersection{wxDateTime::GetDateOnly}\label{wxdatetimegetdateonly} + +\constfunc{wxDateTime}{GetDateOnly}{\void} + +Returns the object having the same date component as this one but time of +00:00:00. + +\newsince{2.8.2} + +\wxheading{See also} + +\helpref{ResetTime}{wxdatetimeresettime} + \membersection{wxDateTime::GetTm}\label{wxdatetimegettm} @@ -784,6 +882,7 @@ Returns {\tt TRUE} if the object represents a valid time moment. Returns broken down representation of the date and time. + \membersection{wxDateTime::GetTicks}\label{wxdatetimegetticks} \constfunc{time\_t}{GetTicks}{\void} @@ -791,54 +890,70 @@ Returns broken down representation of the date and time. 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::GetCentury}\label{wxdatetimegetcentury} + +\constfunc{int}{GetCentury}{\param{const TimeZone\& }{tz = Local}} + +Returns the century of this date. + + \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}} @@ -846,16 +961,23 @@ Returns the milliseconds in the given timezone (local one by default). 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 year is, according to international standards, the one containing Jan 4 or, +equivalently, the first week which has Thursday in this year. Both of these +definitions are the same as saying that the first week of the year must contain +more than half of its days in this year. Accordingly, the week number will +always be 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. +specified by the {\it flags} argument but its results for +\texttt{Sunday\_First} are not well-defined as the ISO definition quoted above +applies to the weeks starting on Monday only. + \membersection{wxDateTime::GetWeekOfMonth}\label{wxdatetimegetweekofmonth} @@ -867,83 +989,114 @@ 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}} -Returns {\tt TRUE} is this day is not a holiday in the given country. +Returns {\tt true} is this day is not a holiday in the given country. + \membersection{wxDateTime::IsGregorianDate}\label{wxdatetimeisgregoriandate} \constfunc{bool}{IsGregorianDate}{\param{GregorianAdoption }{country = Gr\_Standard}} -Returns {\tt TRUE} if the given date os later than the date of adoption of the +Returns {\tt true} if the given date is later than the date of adoption of the Gregorian calendar in the given country (and hence the Gregorian calendar calculations make sense for it). +%%%%%%%%%%%%%%%%%%%%%% 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. + %%%%%%%%%%%%%%%%%%%%%%%%%%% comparison %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \membersection{wxDateTime::IsEqualTo}\label{wxdatetimeisequalto} \constfunc{bool}{IsEqualTo}{\param{const wxDateTime\& }{datetime}} -Returns {\tt TRUE} if the two dates are strictly identical. +Returns {\tt true} if the two dates are strictly identical. + \membersection{wxDateTime::IsEarlierThan}\label{wxdatetimeisearlierthan} \constfunc{bool}{IsEarlierThan}{\param{const wxDateTime\& }{datetime}} -Returns {\tt TRUE} if this date precedes the given one. +Returns {\tt true} if this date precedes the given one. + \membersection{wxDateTime::IsLaterThan}\label{wxdatetimeislaterthan} \constfunc{bool}{IsLaterThan}{\param{const wxDateTime\& }{datetime}} -Returns {\tt TRUE} if this date is later than the given one. +Returns {\tt true} if this date is later than the given one. + \membersection{wxDateTime::IsStrictlyBetween}\label{wxdatetimeisstrictlybetween} \constfunc{bool}{IsStrictlyBetween}{\param{const wxDateTime\& }{t1}, \param{const wxDateTime\& }{t2}} -Returns {\tt TRUE} if this date lies strictly between the two others, +Returns {\tt true} if this date lies strictly between the two others, \wxheading{See also} \helpref{IsBetween}{wxdatetimeisbetween} + \membersection{wxDateTime::IsBetween}\label{wxdatetimeisbetween} \constfunc{bool}{IsBetween}{\param{const wxDateTime\& }{t1}, \param{const wxDateTime\& }{t2}} -Returns {\tt TRUE} if \helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween} -is {\tt TRUE} or if the date is equal to one of the limit values. +Returns {\tt true} if \helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween} +is {\tt true} or if the date is equal to one of the limit values. \wxheading{See also} \helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween} + \membersection{wxDateTime::IsSameDate}\label{wxdatetimeissamedate} \constfunc{bool}{IsSameDate}{\param{const wxDateTime\& }{dt}} -Returns {\tt TRUE} if the date is the same without comparing the time parts. +Returns {\tt true} if the date is the same without comparing the time parts. + \membersection{wxDateTime::IsSameTime}\label{wxdatetimeissametime} \constfunc{bool}{IsSameTime}{\param{const wxDateTime\& }{dt}} -Returns {\tt TRUE} if the time is the same (although dates may differ). +Returns {\tt true} if the time is the same (although dates may differ). + \membersection{wxDateTime::IsEqualUpTo}\label{wxdatetimeisequalupto} \constfunc{bool}{IsEqualUpTo}{\param{const wxDateTime\& }{dt}, \param{const wxTimeSpan\& }{ts}} -Returns {\tt TRUE} if the date is equal to another one up to the given time +Returns {\tt true} if the date is equal to another one up to the given time 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}} @@ -956,17 +1109,7 @@ Adds the given time span to this object. \pythonnote{This method is named {\tt AddTS} in wxPython.} -\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.} \membersection{wxDateTime::Add}\label{wxdatetimeaddds} @@ -980,6 +1123,22 @@ Adds the given date span to this object. \pythonnote{This method is named {\tt AddDS} in wxPython.} + + +\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.} + + + \membersection{wxDateTime::Subtract}\label{wxdatetimesubtractds} \constfunc{wxDateTime}{Subtract}{\param{const wxDateSpan\& }{diff}} @@ -992,6 +1151,8 @@ Subtracts the given date span from this object. \pythonnote{This method is named {\tt SubtractDS} in wxPython.} + + \membersection{wxDateTime::Subtract}\label{wxdatetimesubtractdt} \constfunc{wxTimeSpan}{Subtract}{\param{const wxDateTime\& }{dt}} @@ -1001,6 +1162,7 @@ as wxTimeSpan. %%%%%%%%%%%%%%%%%%%%%%%%%%% parsing/formatting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \membersection{wxDateTime::ParseRfc822Date}\label{wxdatetimeparserfc822date} \func{const wxChar *}{ParseRfc822Date}{\param{const wxChar* }{date}} @@ -1021,29 +1183,32 @@ 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}} +\func{const wxChar *}{ParseFormat}{\param{const wxChar *}{date}, \param{const wxChar *}{format = wxDefaultDateTimeFormat}, \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, -but even if it is not, this function is still implemented (although support -for locale-dependent format specificators such as {\tt "\%c"}, {\tt "\%x"} or -{\tt "\%X"} may be not perfect). This function does handle the month and -weekday names in the current locale on all platforms, however. +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. -Please the description of ANSI C function {\tt strftime(3)} for the syntax of -the format string. +Please see the description of the ANSI C function {\tt strftime(3)} for the syntax +of the format string. The {\it dateDef} parameter is used to fill in the fields which could not be -determined from the format string. For example, if the format is {\tt "\%d"} -(the day 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 +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 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}} @@ -1057,18 +1222,20 @@ can not be parsed in any way at all. Returns {\tt NULL} if the conversion failed, otherwise return the pointer to the character which stopped the scan. + \membersection{wxDateTime::ParseDate}\label{wxdatetimeparsedate} \func{const wxChar *}{ParseDate}{\param{const wxChar *}{date}} This function is like \helpref{ParseDateTime}{wxdatetimeparsedatetime}, but it -only allows the date to be specified. It is thus less flexible then +only allows the date to be specified. It is thus less flexible then \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}} @@ -1079,14 +1246,15 @@ 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}} +\constfunc{wxString }{Format}{\param{const wxChar *}{format = wxDefaultDateTimeFormat}, \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 +It also accepts a few wxWidgets-specific extensions: you can optionally specify the width of the field to follow using {\tt printf(3)}-like syntax and the format specification {\tt \%l} can be used to get the number of milliseconds. @@ -1094,6 +1262,7 @@ format specification {\tt \%l} can be used to get the number of milliseconds. \helpref{ParseFormat}{wxdatetimeparseformat} + \membersection{wxDateTime::FormatDate}\label{wxdatetimeformatdate} \constfunc{wxString }{FormatDate}{\void} @@ -1101,6 +1270,7 @@ format specification {\tt \%l} can be used to get the number of milliseconds. 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} @@ -1108,6 +1278,7 @@ argument (which means `preferred date representation for the current locale'). 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} @@ -1115,6 +1286,7 @@ argument (which means `preferred time representation for the current locale'). This function returns the date representation in the ISO 8601 format (YYYY-MM-DD). + \membersection{wxDateTime::FormatISOTime}\label{wxdatetimeformatisotime} \constfunc{wxString }{FormatISOTime}{\void} @@ -1124,23 +1296,26 @@ This function returns the time representation in the ISO 8601 format %%%%%%%%%%%%%%%%%%%%%%%%%%% calendar calculations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \membersection{wxDateTime::SetToWeekDayInSameWeek}\label{wxdatetimesettoweekdayinsameweek} -\func{wxDateTime\&}{SetToWeekDayInSameWeek}{\param{WeekDay }{weekday}} +\func{wxDateTime\&}{SetToWeekDayInSameWeek}{\param{WeekDay }{weekday}, \param{WeekFlags}{flags = {\tt Monday\_First}}} 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} -\constfunc{wxDateTime}{GetWeekDayInSameWeek}{\param{WeekDay }{weekday}} +\constfunc{wxDateTime}{GetWeekDayInSameWeek}{\param{WeekDay }{weekday}, \param{WeekFlags}{flags = {\tt Monday\_First}}} Returns the copy of this object to which \helpref{SetToWeekDayInSameWeek}{wxdatetimesettoweekdayinsameweek} was applied. + \membersection{wxDateTime::SetToNextWeekDay}\label{wxdatetimesettonextweekday} \func{wxDateTime\&}{SetToNextWeekDay}{\param{WeekDay }{weekday}} @@ -1150,6 +1325,7 @@ date. Returns the reference to the modified object itself. + \membersection{wxDateTime::GetNextWeekDay}\label{wxdatetimegetnextweekday} \constfunc{wxDateTime}{GetNextWeekDay}{\param{WeekDay }{weekday}} @@ -1157,6 +1333,7 @@ Returns the reference to the modified object itself. Returns the copy of this object to which \helpref{SetToNextWeekDay}{wxdatetimesettonextweekday} was applied. + \membersection{wxDateTime::SetToPrevWeekDay}\label{wxdatetimesettoprevweekday} \func{wxDateTime\&}{SetToPrevWeekDay}{\param{WeekDay }{weekday}} @@ -1166,6 +1343,7 @@ date. Returns the reference to the modified object itself. + \membersection{wxDateTime::GetPrevWeekDay}\label{wxdatetimegetprevweekday} \constfunc{wxDateTime}{GetPrevWeekDay}{\param{WeekDay }{weekday}} @@ -1173,6 +1351,7 @@ Returns the reference to the modified object itself. 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}} @@ -1184,11 +1363,12 @@ may be either positive (counting from the beginning of the month) or negative For example, {\tt SetToWeekDay(2, wxDateTime::Wed)} will set the date to the second Wednesday in the current month and -{\tt SetToWeekDay(-1, wxDateTime::Sun)} - to the last Sunday in it. +{\tt SetToWeekDay(-1, wxDateTime::Sun)} -- to the last Sunday in it. -Returns {\tt TRUE} if the date was modified successfully, {\tt FALSE} +Returns {\tt true} if the date was modified successfully, {\tt false} 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}} @@ -1196,6 +1376,7 @@ otherwise meaning that the specified date doesn't exist. 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}} @@ -1204,7 +1385,8 @@ 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). -Always returns {\tt TRUE}. +Always returns {\tt true}. + \membersection{wxDateTime::GetLastWeekDay}\label{wxdatetimegetlastweekday} @@ -1213,21 +1395,20 @@ Always returns {\tt TRUE}. Returns the copy of this object to which \helpref{SetToLastWeekDay}{wxdatetimesettolastweekday} was applied. -\membersection{wxDateTime::SetToTheWeek}\label{wxdatetimesettotheweek} -\func{bool}{SetToTheWeek}{\param{wxDateTime\_t }{numWeek}, \param{WeekDay }{weekday = Mon}} +\membersection{wxDateTime::SetToWeekOfYear}\label{wxdatetimesettoweekofyear} -Set the date to the given {\it weekday} in the week with given number -{\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 -date was changed successfully. +\func{static wxDateTime}{SetToWeekOfYear}{\param{int }{year}, \param{wxDateTime\_t }{numWeek}, \param{WeekDay }{weekday = Mon}} -\membersection{wxDateTime::GetWeek}\label{wxdatetimegetweek} +Set the date to the given \arg{weekday} in the week number \arg{numWeek} of the +given \arg{year} . The number should be in range $1\ldots53$. -\constfunc{wxDateTime}{GetWeek}{\param{wxDateTime\_t }{numWeek}, \param{WeekDay }{weekday = Mon}} +Note that the returned date may be in a different year than the one passed to +this function because both the week $1$ and week $52$ or $53$ (for leap years) +contain days from different years. See +\helpref{GetWeekOfYear}{wxdatetimegetweekofyear} for the explanation of how the +year weeks are counted. -Returns the copy of this object to which -\helpref{SetToTheWeek}{wxdatetimesettotheweek} was applied. \membersection{wxDateTime::SetToLastMonthDay}\label{wxdatetimesettolastmonthday} @@ -1238,6 +1419,7 @@ 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}} @@ -1245,6 +1427,7 @@ Returns the reference to the modified object itself. 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}} @@ -1256,6 +1439,7 @@ the other ones. Returns the reference to the modified object itself. + \membersection{wxDateTime::GetYearDay}\label{wxdatetimegetyearday} \constfunc{wxDateTime}{GetYearDay}{\param{wxDateTime\_t }{yday}} @@ -1265,6 +1449,7 @@ Returns the copy of this object to which %%%%%%%%%%%%%%%%%%%%%%%%%%% astronomical functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \membersection{wxDateTime::GetJulianDayNumber}\label{wxdatetimegetjuliandaynumber} \constfunc{double}{GetJulianDayNumber}{\void} @@ -1276,12 +1461,14 @@ of rounding errors! \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} @@ -1291,12 +1478,14 @@ 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} @@ -1309,41 +1498,64 @@ year 1 is Rata Die day 1. %%%%%%%%%%%%%%%%%%%%%%%%%%% timezone and DST %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\membersection{wxDateTime::FromTimezone}\label{wxdatetimefromtimezone} + +\constfunc{wxDateTime}{FromTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}} + +Transform the date from the given time zone to the local one. If {\it noDST} is +{\tt true}, no DST adjustments will be made. + +Returns the date in the local time zone. + + \membersection{wxDateTime::ToTimezone}\label{wxdatetimetotimezone} -\constfunc{wxDateTime}{ToTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = FALSE}} +\constfunc{wxDateTime}{ToTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}} -Transform the date to the given time zone. If {\it noDST} is {\tt TRUE}, no +Transform the date to the given time zone. If {\it noDST} is {\tt true}, no DST adjustments will be made. Returns the date in the new time zone. + \membersection{wxDateTime::MakeTimezone}\label{wxdatetimemaketimezone} -\func{wxDateTime\&}{MakeTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = FALSE}} +\func{wxDateTime\&}{MakeTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}} Modifies the object in place to represent the date in another time zone. If -{\it noDST} is {\tt TRUE}, no DST adjustments will be made. +{\it noDST} is {\tt true}, no DST adjustments will be made. + + +\membersection{wxDateTime::MakeFromTimezone}\label{wxdatetimemakefromtimezone} -\membersection{wxDateTime::ToGMT}\label{wxdatetimetogmt} +\func{wxDateTime\&}{MakeFromTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}} -\constfunc{wxDateTime}{ToGMT}{\param{bool }{noDST = FALSE}} +Same as \helpref{FromTimezone}{wxdatetimefromtimezone} but modifies the object +in place. + + +\membersection{wxDateTime::ToUTC}\label{wxdatetimetoutc} + +\constfunc{wxDateTime}{ToUTC}{\param{bool }{noDST = false}} This is the same as calling \helpref{ToTimezone}{wxdatetimetotimezone} with the argument {\tt GMT0}. -\membersection{wxDateTime::MakeGMT}\label{wxdatetimemakegmt} -\func{wxDateTime\&}{MakeGMT}{\param{bool }{noDST = FALSE}} +\membersection{wxDateTime::MakeUTC}\label{wxdatetimemakeutc} + +\func{wxDateTime\&}{MakeUTC}{\param{bool }{noDST = false}} 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}} -Returns {\tt TRUE} if the DST is applied for this date in the given country. +Returns {\tt true} if the DST is applied for this date in the given country. \wxheading{See also}