datetime.tex

来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 1,547 行 · 第 1/4 页

TEX
1,547
字号

\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}}

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.


\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 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 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}

\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}}

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 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.


\membersection{wxDateTime::IsEarlierThan}\label{wxdatetimeisearlierthan}

\constfunc{bool}{IsEarlierThan}{\param{const wxDateTime\& }{datetime}}

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.


\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,

\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.

\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.


\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).


\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
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.}



\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}}

\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.}



\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.

This function is intentionally strict, it will return an error for any string
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}

⌨️ 快捷键说明

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