EndOfADay function
Calculates a TDateTime value representing the end of a specified day.
Declaration
function EndOfADay(const AYear: Word; const AMonth: Word;
const ADay: Word): TDateTime; overloadArguments
AYear | Year. |
AMonth | Month in the year. |
ADay | Day in the month. |
Function result
A TDateTime value representing the time 23:59:59.999 of the given day.
Description
EndOfADay
returns a
TDateTime value with the date/time indication of
the last moment (23:59:59.999) of the day given by
AYear,
AMonth,
ADay.
The day may also be indicated with a AYear, ADayOfYear pair.
See also
- StartOfTheDay
- StartOfADay
- StartOfTheWeek
- StartOfAWeek
- StartOfAMonth
- StartOfTheMonth
- EndOfTheWeek
- EndOfAWeek
- EndOfTheYear
- EndOfAYear
- EndOfTheMonth
- EndOfAMonth
- EndOfTheDay
Example: ex39
Program Example39;
{ This program demonstrates the EndOfADay function }
Uses SysUtils,DateUtils;
Const
Fmt = '"End of the day : "dd mmmm yyyy hh:nn:ss';
Var
Y,M,D : Word;
Begin
Y:=YearOf(Today);
M:=MonthOf(Today);
D:=DayOf(Today);
Writeln(FormatDateTime(Fmt,EndOfADay(Y,M,D)));
DecodeDateDay(Today,Y,D);
Writeln(FormatDateTime(Fmt,EndOfADay(Y,D)));
End.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
