%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\class{wxDateTime}}\label{wxdatetime}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\class{wxDateTime}}\label{wxdatetime}
Finally, Inv\_Year is defined to be an invalid value for year parameter.
\helpref{GetMonthName()}{wxdatetimegetmonthname} and
Finally, Inv\_Year is defined to be an invalid value for year parameter.
\helpref{GetMonthName()}{wxdatetimegetmonthname} and
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
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
\helpref{GetWeekOfMonth}{wxdatetimegetweekofmonth}).
The desired behvaiour may be specified by giving one of the following
\helpref{GetWeekOfMonth}{wxdatetimegetweekofmonth}).
The desired behvaiour may be specified by giving one of the following
parameter, it is currently ignored as only the Gregorian calendar is
supported. Future versions will support other calendars.
parameter, it is currently ignored as only the Gregorian calendar is
supported. Future versions will support other calendars.
\helpref{ConvertYearToBC}{wxdatetimeconvertyeartobc}\\
\helpref{GetCurrentMonth}{wxdatetimegetcurrentmonth}\\
\helpref{IsLeapYear}{wxdatetimeisleapyear}\\
\helpref{ConvertYearToBC}{wxdatetimeconvertyeartobc}\\
\helpref{GetCurrentMonth}{wxdatetimegetcurrentmonth}\\
\helpref{IsLeapYear}{wxdatetimeisleapyear}\\
\helpref{GetNumberOfDays}{wxdatetimegetnumberofdays}\\
\helpref{GetNumberOfDays}{wxdatetimegetnumberofdays}\\
\helpref{GetMonthName}{wxdatetimegetmonthname}\\
\helpref{GetNumberOfDays}{wxdatetimegetnumberofdays}\\
\helpref{GetNumberOfDays}{wxdatetimegetnumberofdays}\\
\helpref{GetMonthName}{wxdatetimegetmonthname}\\
\membersection{Accessors}\label{datetimeaccessors}
Here are the trivial accessors. Other functions, which might have to perform
\membersection{Accessors}\label{datetimeaccessors}
Here are the trivial accessors. Other functions, which might have to perform
\helpref{Calendar calculations}{datetimecalculations} section.
\helpref{IsValid}{wxdatetimeisvalid}\\
\helpref{GetTicks}{wxdatetimegetticks}\\
\helpref{Calendar calculations}{datetimecalculations} section.
\helpref{IsValid}{wxdatetimeisvalid}\\
\helpref{GetTicks}{wxdatetimegetticks}\\
\helpref{GetYear}{wxdatetimegetyear}\\
\helpref{GetMonth}{wxdatetimegetmonth}\\
\helpref{GetDay}{wxdatetimegetday}\\
\helpref{GetYear}{wxdatetimegetyear}\\
\helpref{GetMonth}{wxdatetimegetmonth}\\
\helpref{GetDay}{wxdatetimegetday}\\
These functions convert wxDateTime objects to and from text. The
conversions to text are mostly trivial: you can either do it using the default
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
+date and time representations for the current locale (
+\helpref{FormatDate}{wxdatetimeformatdate} and
\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
\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
\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
which (still...) defines the format of email messages on the Internet. This
\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
which (still...) defines the format of email messages on the Internet. This
-But the most interesting functions are
-\helpref{ParseTime}{wxdatetimeparsetime},
-\helpref{ParseDate}{wxdatetimeparsedate} and
+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
\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
Please see the \helpref{time zone overview}{tdatetimezones} for more
information about time zones. Normally, these functions should be rarely used.
Please see the \helpref{time zone overview}{tdatetimezones} for more
information about time zones. Normally, these functions should be rarely used.
-\helpref{ToGMT}{wxdatetimetogmt}\\
-\helpref{MakeGMT}{wxdatetimemakegmt}\\
+\helpref{MakeFromTimezone}{wxdatetimemakefromtimezone}\\
+\helpref{ToUTC}{wxdatetimetoutc}\\
+\helpref{MakeUTC}{wxdatetimemakeutc}\\
\helpref{GetBeginDST}{wxdatetimegetbegindst}\\
\helpref{GetEndDST}{wxdatetimegetenddst}\\
\helpref{IsDST}{wxdatetimeisdst}
\helpref{GetBeginDST}{wxdatetimegetbegindst}\\
\helpref{GetEndDST}{wxdatetimegetenddst}\\
\helpref{IsDST}{wxdatetimeisdst}
Get the current century, i.e. first two digits of the year, in given calendar
(only Gregorian is currently supported).
Get the current century, i.e. first two digits of the year, in given calendar
(only Gregorian is currently supported).
-\func{static struct tm *}{GetTmNow}{\void}
+\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}
+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.
\helpref{wxDateTime::UNow}{wxdatetimeunow} should be used for better precision
(but it is less efficient and might not be available on all platforms).
\helpref{wxDateTime::UNow}{wxdatetimeunow} should be used for better precision
(but it is less efficient and might not be available on all platforms).
-\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}
\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}
\membersection{wxDateTime::GetYear}\label{wxdatetimegetyear}
\constfunc{int}{GetYear}{\param{const TimeZone\& }{tz = Local}}
\membersection{wxDateTime::GetYear}\label{wxdatetimegetyear}
\constfunc{int}{GetYear}{\param{const TimeZone\& }{tz = Local}}
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
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
\texttt{Sunday\_First} are not well-defined as the ISO definition quoted above
applies to the weeks starting on Monday only.
\texttt{Sunday\_First} are not well-defined as the ISO definition quoted above
applies to the weeks starting on Monday only.
-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}
+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}
-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}
+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}
-\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,
This function parses the string {\it date} according to the given
{\it format}. The system {\tt strptime(3)} function is used whenever available,
can not be parsed in any way at all.
Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
can not be parsed in any way at all.
Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
\func{const wxChar *}{ParseDate}{\param{const wxChar *}{date}}
This function is like \helpref{ParseDateTime}{wxdatetimeparsedatetime}, but it
\func{const wxChar *}{ParseDate}{\param{const wxChar *}{date}}
This function is like \helpref{ParseDateTime}{wxdatetimeparsedatetime}, but it
\helpref{ParseDateTime}{wxdatetimeparsedatetime}, but also has less chances to
misinterpret the user input.
\helpref{ParseDateTime}{wxdatetimeparsedatetime}, but also has less chances to
misinterpret the user input.
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.
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.
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)
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)
+\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}}
\membersection{wxDateTime::ToTimezone}\label{wxdatetimetotimezone}
\constfunc{wxDateTime}{ToTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}}
-\membersection{wxDateTime::ToGMT}\label{wxdatetimetogmt}
+\membersection{wxDateTime::MakeFromTimezone}\label{wxdatetimemakefromtimezone}
+
+\func{wxDateTime\&}{MakeFromTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}}
+
+Same as \helpref{FromTimezone}{wxdatetimefromtimezone} but modifies the object
+in place.
+
+
+\membersection{wxDateTime::ToUTC}\label{wxdatetimetoutc}