⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datetime.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
📖 第 1 页 / 共 4 页
字号:
\membersection{wxDateTime::ParseFormat}\label{wxdatetimeparseformat}\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 supportfor locale-dependent format specifiers such as {\tt "\%c"}, {\tt "\%x"} or {\tt "\%X"} maynot be perfect and GNU extensions such as {\tt "\%z"} and {\tt "\%Z"} arenot implemented. This function does handle the month and weekdaynames in the current locale on all platforms, however.Please see the description of the ANSI C function {\tt strftime(3)} for the syntaxof the format string.The {\it dateDef} parameter is used to fill in the fields which could not bedetermined from the format string. For example, if the format is {\tt "\%d"} (theay of the month), the month and the year are taken from {\it dateDef}. Ifit is not specified, \helpref{Today}{wxdatetimetoday} is used as thedefault date.Returns {\tt NULL} if the conversion failed, otherwise return the pointer tothe 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 dateand time. Unlike \helpref{ParseRfc822Date}{wxdatetimeparserfc822date}, itwill accept anything that may be accepted and will only reject strings whichcan not be parsed in any way at all.Returns {\tt NULL} if the conversion failed, otherwise return the pointer tothe 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 itonly allows the date to be specified. It is thus less flexible then\helpref{ParseDateTime}{wxdatetimeparsedatetime}, but also has less chances tomisinterpret the user input.Returns {\tt NULL} if the conversion failed, otherwise return the pointer tothe 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}, butonly allows the time to be specified in the input string.Returns {\tt NULL} if the conversion failed, otherwise return the pointer tothe character which stopped the scan.\membersection{wxDateTime::Format}\label{wxdatetimeformat}\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 wxWidgets-specific extensions: you can optionally specifythe width of the field to follow using {\tt printf(3)}-like syntax and theformat specification {\tt \%l} can be used to get the number of milliseconds.\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}\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 itsweek 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}, \param{WeekFlags}{flags = {\tt Monday\_First}}}Returns the copy of this object to which\helpref{SetToWeekDayInSameWeek}{wxdatetimesettoweekdayinsameweek} wasapplied.\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 currentdate.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 currentdate.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 givenyear (the current month and year are used by default). The parameter {\it n}may be either positive (counting from the beginning of the month) or negative(counting from the end of it).For example, {\tt SetToWeekDay(2, wxDateTime::Wed)} will set the date to thesecond Wednesday in the current month and{\tt SetToWeekDay(-1, wxDateTime::Sun)} -- to the last Sunday in it.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}}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).Always returns {\tt true}.\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::SetToWeekOfYear}\label{wxdatetimesettoweekofyear}\func{static wxDateTime}{SetToWeekOfYear}{\param{int }{year}, \param{wxDateTime\_t }{numWeek}, \param{WeekDay }{weekday = Mon}}Set the date to the given \arg{weekday} in the week number \arg{numWeek} of thegiven \arg{year} . The number should be in range $1\ldots53$.Note that the returned date may be in a different year than the one passed tothis 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 theyear weeks are counted.\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 bydefault).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 theother functions, this one does not use the current year). The day numbershould be in the range $1\ldots366$ for the leap years and $1\ldots365$ forthe 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. Bewareof 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 integralMJDs correspond to midnights of the dates in the Gregorian calendar and not thnoons 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 daysrelative to a base date of December 31 of the year 0. Thus January 1 of theyear 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}}Transform the date to the given time zone. If {\it noDST} is {\tt true}, noDST 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}}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.\membersection{wxDateTime::MakeFromTimezone}\label{wxdatetimemakefromtimezone}\func{wxDateTime\&}{MakeFromTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}}Same as \helpref{FromTimezone}{wxdatetimefromtimezone} but modifies the objectin place.\membersection{wxDateTime::ToUTC}\label{wxdatetimetoutc}\constfunc{wxDateTime}{ToUTC}{\param{bool }{noDST = false}}This is the same as calling \helpref{ToTimezone}{wxdatetimetotimezone} withthe argument {\tt GMT0}.\membersection{wxDateTime::MakeUTC}\label{wxdatetimemakeutc}\func{wxDateTime\&}{MakeUTC}{\param{bool }{noDST = false}}This is the same as calling \helpref{MakeTimezone}{wxdatetimemaketimezone} withthe 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.\wxheading{See also}\helpref{GetBeginDST}{wxdatetimegetbegindst} and\helpref{GetEndDST}{wxdatetimegetenddst}\section{\class{wxDateTimeHolidayAuthority}}\label{wxdatetimeholidayauthority}TODO\section{\class{wxDateTimeWorkDays}}\label{wxdatetimeworkdays}TODO

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -