|
@@ -456,69 +456,129 @@ In case one of the parameters is outside of it's valid range, 0 is returned.
|
|
\Declaration
|
|
\Declaration
|
|
Function FileDateToDateTime(Filedate : Longint) : TDateTime;
|
|
Function FileDateToDateTime(Filedate : Longint) : TDateTime;
|
|
\Description
|
|
\Description
|
|
|
|
+\var{FileDateToDateTime} converts the date/time encoded in \var{filedate}
|
|
|
|
+to a \var{TDateTime} encoded form. It can be used to convert date/time values
|
|
|
|
+returned by the \seef{FileAge} or \seef{FindFirst}/\seef{FindNext}
|
|
|
|
+functions to \var{TDateTime} form.
|
|
\Errors
|
|
\Errors
|
|
|
|
+None.
|
|
\SeeAlso
|
|
\SeeAlso
|
|
|
|
+\seef{DateTimeToFileDate}
|
|
\end{function}
|
|
\end{function}
|
|
|
|
|
|
|
|
+\latex{\inputlisting{sysutex/ex13.pp}}
|
|
|
|
+\html{\input{sysutex/ex13.tex}}
|
|
|
|
|
|
\begin{function}{FormatDateTime}
|
|
\begin{function}{FormatDateTime}
|
|
\Declaration
|
|
\Declaration
|
|
Function FormatDateTime(FormatStr: string; DateTime: TDateTime):string;
|
|
Function FormatDateTime(FormatStr: string; DateTime: TDateTime):string;
|
|
\Description
|
|
\Description
|
|
|
|
+\var{FormatDateTime} formats the date and time encoded in \var{DateTime}
|
|
|
|
+according to the formatting given in \var{FormatStr}. The complete list
|
|
|
|
+of formatting characters can be found in \sees{formatchars}.
|
|
\Errors
|
|
\Errors
|
|
|
|
+On error (such as an invalid character in the formatting string), and
|
|
|
|
+\var{EConvertError} exception is raised.
|
|
\SeeAlso
|
|
\SeeAlso
|
|
|
|
+\seef{DateTimeToStr}, \seef{DateToStr}, \seef{TimeToStr},
|
|
|
|
+\seef{StrToDateTime}
|
|
\end{function}
|
|
\end{function}
|
|
|
|
|
|
|
|
+\latex{\inputlisting{sysutex/ex14.pp}}
|
|
|
|
+\html{\input{sysutex/ex14.tex}}
|
|
|
|
+
|
|
|
|
|
|
\begin{function}{IncMonth}
|
|
\begin{function}{IncMonth}
|
|
\Declaration
|
|
\Declaration
|
|
Function IncMonth(const DateTime: TDateTime; NumberOfMonths: integer): TDateTime;
|
|
Function IncMonth(const DateTime: TDateTime; NumberOfMonths: integer): TDateTime;
|
|
\Description
|
|
\Description
|
|
|
|
+\var{IncMonth} increases the month number in \var{DateTime} with
|
|
|
|
+\var{NumberOfMonths}. It wraps the result as to get a month between 1 and
|
|
|
|
+12, and updates the year accordingly. \var{NumberOfMonths} can be negative,
|
|
|
|
+and can be larger than 12 (in absolute value).
|
|
\Errors
|
|
\Errors
|
|
|
|
+None.
|
|
\SeeAlso
|
|
\SeeAlso
|
|
|
|
+\seef{Date}, \seef{Time}, \seef{Now}
|
|
\end{function}
|
|
\end{function}
|
|
|
|
|
|
|
|
+
|
|
|
|
+\latex{\inputlisting{sysutex/ex15.pp}}
|
|
|
|
+\html{\input{sysutex/ex15.tex}}
|
|
|
|
|
|
\begin{function}{IsLeapYear}
|
|
\begin{function}{IsLeapYear}
|
|
\Declaration
|
|
\Declaration
|
|
Function IsLeapYear(Year: Word): boolean;
|
|
Function IsLeapYear(Year: Word): boolean;
|
|
\Description
|
|
\Description
|
|
|
|
+\var{IsLeapYear} returns \var{True} if \var{Year} is a leap year,
|
|
|
|
+\var{False} otherwise
|
|
\Errors
|
|
\Errors
|
|
|
|
+None.
|
|
\SeeAlso
|
|
\SeeAlso
|
|
|
|
+\seef{IncMonth}, \seef{Date}
|
|
\end{function}
|
|
\end{function}
|
|
|
|
|
|
|
|
+\latex{\inputlisting{sysutex/ex16.pp}}
|
|
|
|
+\html{\input{sysutex/ex16.tex}}
|
|
|
|
|
|
\begin{function}{MSecsToTimeStamp}
|
|
\begin{function}{MSecsToTimeStamp}
|
|
\Declaration
|
|
\Declaration
|
|
Function MSecsToTimeStamp(MSecs: Comp): TTimeStamp;
|
|
Function MSecsToTimeStamp(MSecs: Comp): TTimeStamp;
|
|
\Description
|
|
\Description
|
|
|
|
+\var{MSecsTiTimeStamp} converts the given number of milliseconds to
|
|
|
|
+a \var{TTimeStamp} date/time notation.
|
|
\Errors
|
|
\Errors
|
|
|
|
+None.
|
|
\SeeAlso
|
|
\SeeAlso
|
|
|
|
+\seef{TimeStampToMSecs}, \seef{DateTimeToTimeStamp},
|
|
\end{function}
|
|
\end{function}
|
|
|
|
|
|
|
|
+\latex{\inputlisting{sysutex/ex17.pp}}
|
|
|
|
+\html{\input{sysutex/ex17.tex}}
|
|
|
|
|
|
\begin{function}{Now}
|
|
\begin{function}{Now}
|
|
\Declaration
|
|
\Declaration
|
|
Function Now: TDateTime;
|
|
Function Now: TDateTime;
|
|
\Description
|
|
\Description
|
|
|
|
+\var{Now} returns the current date and time. It is equivalent to
|
|
|
|
+\var{Date+Time}.
|
|
\Errors
|
|
\Errors
|
|
|
|
+None.
|
|
\SeeAlso
|
|
\SeeAlso
|
|
|
|
+\seef{Date}, \seef{Time}
|
|
\end{function}
|
|
\end{function}
|
|
|
|
|
|
|
|
+\latex{\inputlisting{sysutex/ex18.pp}}
|
|
|
|
+\html{\input{sysutex/ex18.tex}}
|
|
|
|
|
|
\begin{function}{StrToDate}
|
|
\begin{function}{StrToDate}
|
|
\Declaration
|
|
\Declaration
|
|
Function StrToDate(const S: string): TDateTime;
|
|
Function StrToDate(const S: string): TDateTime;
|
|
\Description
|
|
\Description
|
|
|
|
+\var{StrToDate} converts the string \var{S} to a \var{TDateTime} date
|
|
|
|
+value. The Date must consist of 1 to three digits, separated by the
|
|
|
|
+\var{DateSeparator} character. If two numbers are given, they
|
|
|
|
+are supposed to form the day and month of the current year. If only
|
|
|
|
+one number is given, it is supposed to represent the day of the
|
|
|
|
+current month. (This is \em{not} supported in Delphi)
|
|
|
|
+
|
|
|
|
+The order of the digits (y/m/d, m/d/y, d/m/y) is determined from the
|
|
|
|
+\var{ShortDateFormat} variable.
|
|
\Errors
|
|
\Errors
|
|
|
|
+On error (e.g. an invalid date or invalid character),
|
|
|
|
+a \var{EConvertError} exception is raised.
|
|
\SeeAlso
|
|
\SeeAlso
|
|
|
|
+\seef{StrToTime}, \seef{DateToStr}n \seef{TimeToStr}.
|
|
\end{function}
|
|
\end{function}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ \latex{\inputlisting{sysutex/ex19.pp}}
|
|
|
|
+\html{\input{sysutex/ex19.tex}}
|
|
|
|
+
|
|
\begin{function}{StrToDateTime}
|
|
\begin{function}{StrToDateTime}
|
|
\Declaration
|
|
\Declaration
|
|
Function StrToDateTime(const S: string): TDateTime;
|
|
Function StrToDateTime(const S: string): TDateTime;
|
|
\Description
|
|
\Description
|
|
|
|
+
|
|
\Errors
|
|
\Errors
|
|
\SeeAlso
|
|
\SeeAlso
|
|
\end{function}
|
|
\end{function}
|