RecodeMonth function
Replace month part of a
TDateTime value with another month.
Declaration
function RecodeMonth(const AValue: TDateTime; const AMonth: Word)
: TDateTimeArguments
AValue | Date to recode. |
AMonth | Month to replace in
|
Function result
AValue with replaced month.Description
RecodeMonth replaces the Month part of the timestamp
AValue
with
AMonth. All other parts of the date/time stamp are left untouched.Errors
If the
AMonth value is not within a valid range (1..12) then
an
EConvertError exception is raised.
See also
- RecodeYear
- RecodeDay
- RecodeHour
- RecodeMinute
- RecodeSecond
- RecodeMilliSecond
- RecodeDate
- RecodeTime
- RecodeDateTime
Example: ex88
Program Example88;
{ This program demonstrates the RecodeMonth function }
Uses SysUtils,DateUtils;
Const
Fmt = 'dddd dd mmmm yyyy hh:nn:ss';
Var
S : AnsiString;
Begin
S:=FormatDateTime(Fmt,RecodeMonth(Now,5));
Writeln('This moment in May : ',S);
End.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
