mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 18:19:16 +02:00
+ Added first three function descriptions
This commit is contained in:
parent
d9749fb889
commit
0e827b5b18
@ -54,7 +54,7 @@ type
|
|||||||
Date: integer; { One plus number of days since 1/1/0001 }
|
Date: integer; { One plus number of days since 1/1/0001 }
|
||||||
end ;
|
end ;
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
The following type is used in the \seep{FindFirst},\seep{FindNext}
|
The following type is used in the \seef{FindFirst},\seef{FindNext}
|
||||||
and \seep{FindClose} functions. The \var{win32} version differs from
|
and \seep{FindClose} functions. The \var{win32} version differs from
|
||||||
the other versions. If code is to be portable, that part shouldn't
|
the other versions. If code is to be portable, that part shouldn't
|
||||||
be used.
|
be used.
|
||||||
@ -191,6 +191,7 @@ Const
|
|||||||
\section{Date and time functions}
|
\section{Date and time functions}
|
||||||
|
|
||||||
\subsection{Date and time formatting characters}
|
\subsection{Date and time formatting characters}
|
||||||
|
|
||||||
Various date and time formatting routines accept a format string.
|
Various date and time formatting routines accept a format string.
|
||||||
to format the date and or time. The following characters can be used
|
to format the date and or time. The following characters can be used
|
||||||
to control the date and time formatting:
|
to control the date and time formatting:
|
||||||
@ -225,38 +226,103 @@ to control the date and time formatting:
|
|||||||
\item['xx'] : literal text
|
\item['xx'] : literal text
|
||||||
\end{description}
|
\end{description}
|
||||||
|
|
||||||
|
\begin{type}{TDateTime}
|
||||||
|
\Declaration
|
||||||
|
TDateTime = Double;
|
||||||
|
\Description
|
||||||
|
Many functions return or require a \var{TDateTime} type, which contains
|
||||||
|
a date and time in encoded form. The date and time are converted to a double
|
||||||
|
as follows:
|
||||||
|
\end{type}
|
||||||
|
|
||||||
\begin{function}{Date}
|
\begin{function}{Date}
|
||||||
\Declaration
|
\Declaration
|
||||||
Function Date: TDateTime;
|
Function Date: TDateTime;
|
||||||
\Description
|
\Description
|
||||||
|
\var{Date} returns the current date in \var{TDateTime} format.
|
||||||
|
For more information about the \var{TDateTime} type, see \seety{TDateTime}.
|
||||||
\Errors
|
\Errors
|
||||||
|
None.
|
||||||
\SeeAlso
|
\SeeAlso
|
||||||
|
\seef{Time},\seef{Now}, \seety{TDateTime}.
|
||||||
\end{function}
|
\end{function}
|
||||||
|
|
||||||
|
\latex{\inputlisting{sysutex/ex1.pp}}
|
||||||
|
\html{\input{sysutex/ex1.tex}}
|
||||||
|
|
||||||
\begin{function}{DateTimeToFileDate}
|
\begin{function}{DateTimeToFileDate}
|
||||||
\Declaration
|
\Declaration
|
||||||
Function DateTimeToFileDate(DateTime : TDateTime) : Longint;
|
Function DateTimeToFileDate(DateTime : TDateTime) : Longint;
|
||||||
\Description
|
\Description
|
||||||
|
\var{DateTimeToFileDate} function converts a date/time indication in
|
||||||
|
\var{TDateTime} format to a filedate function, such as returned for
|
||||||
|
instance by the \seef{FileAge} function.
|
||||||
\Errors
|
\Errors
|
||||||
|
None.
|
||||||
\SeeAlso
|
\SeeAlso
|
||||||
|
\seef{Time}, \seef{Date}, \seef{FileDateToDateTime}
|
||||||
\end{function}
|
\end{function}
|
||||||
|
|
||||||
|
\latex{\inputlisting{sysutex/ex2.pp}}
|
||||||
|
\html{\input{sysutex/ex2.tex}}
|
||||||
|
|
||||||
\begin{function}{DateTimeToStr}
|
\begin{function}{DateTimeToStr}
|
||||||
\Declaration
|
\Declaration
|
||||||
Function DateTimeToStr(DateTime: TDateTime): string;
|
Function DateTimeToStr(DateTime: TDateTime): string;
|
||||||
\Description
|
\Description
|
||||||
|
\var{DateTimeToStr} returns a string representation of
|
||||||
|
\var{DateTime} using the formatting specified in
|
||||||
|
\var{ShortDateTimeFormat}. It corresponds to a call to
|
||||||
|
\var{FormatDateTime('c',DateTime)}.
|
||||||
\Errors
|
\Errors
|
||||||
|
None.
|
||||||
\SeeAlso
|
\SeeAlso
|
||||||
|
\seef{FormatDateTime}, \seety{TDateTime}.
|
||||||
\end{function}
|
\end{function}
|
||||||
|
|
||||||
|
\latex{\inputlisting{sysutex/ex3.pp}}
|
||||||
|
\html{\input{sysutex/ex3.tex}}
|
||||||
|
|
||||||
\begin{procedure}{DateTimeToString}
|
\begin{procedure}{DateTimeToString}
|
||||||
\Declaration
|
\Declaration
|
||||||
Procedure DateTimeToString(var Result: string; const FormatStr: string; const DateTime: TDateTime);
|
Procedure DateTimeToString(var Result: string; const FormatStr: string; const DateTime: TDateTime);
|
||||||
\Description
|
\Description
|
||||||
|
\var{DateTimeToString} returns in \var{Result} a string representation of
|
||||||
|
\var{DateTime} using the formatting specified in \var{FormatStr}.
|
||||||
|
|
||||||
|
The following formatting characters can be used in \var{FormatStr}:
|
||||||
|
\begin{description}
|
||||||
|
\item[c] : shortdateformat + ' ' + shorttimeformat
|
||||||
|
\item[d] : day of month
|
||||||
|
\item[dd] : day of month (leading zero)
|
||||||
|
\item[ddd] : day of week (abbreviation)
|
||||||
|
\item[dddd] : day of week (full)
|
||||||
|
\item[ddddd] : shortdateformat
|
||||||
|
\item[dddddd] : longdateformat
|
||||||
|
\item[m] : month
|
||||||
|
\item[mm] : month (leading zero)
|
||||||
|
\item[mmm] : month (abbreviation)
|
||||||
|
\item[mmmm] : month (full)
|
||||||
|
\item[y] : year (four digits)
|
||||||
|
\item[yy] : year (two digits)
|
||||||
|
\item[yyyy] : year (with century)
|
||||||
|
\item[h] : hour
|
||||||
|
\item[hh] : hour (leading zero)
|
||||||
|
\item[n] : minute
|
||||||
|
\item[nn] : minute (leading zero)
|
||||||
|
\item[s] : second
|
||||||
|
\item[ss] : second (leading zero)
|
||||||
|
\item[t] : shorttimeformat
|
||||||
|
\item[tt] : longtimeformat
|
||||||
|
\item[am/pm] : use 12 hour clock and display am and pm accordingly
|
||||||
|
\item[a/p] : use 12 hour clock and display a and p accordingly
|
||||||
|
\item[/] : insert date seperator
|
||||||
|
\item[:] : insert time seperator
|
||||||
|
\item["xx"] : literal text
|
||||||
|
\item['xx'] : literal text
|
||||||
|
\end{description}
|
||||||
\Errors
|
\Errors
|
||||||
|
None.
|
||||||
\SeeAlso
|
\SeeAlso
|
||||||
\end{procedure}
|
\end{procedure}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user