DecodeDateTime procedure
Decode a TDateTime value in a date and time value.
Declaration
procedure DecodeDateTime(const AValue: TDateTime; out AYear: Word;
out AMonth: Word; out ADay: Word;
out AHour: Word; out AMinute: Word;
out ASecond: Word; out AMilliSecond: Word)Arguments
AValue | TDateTime to decode. |
AYear | Returns the year part of
|
AMonth | Returns the month part of
|
ADay | Returns the day part of
|
AHour | Returns the hour part of
|
AMinute | Returns the minute part of
|
ASecond | Returns the second part of
|
AMilliSecond | Returns the millisecond part of
|
Description
DecodeDateTime decomposes the date/time indication in
AValue and returns the various components in
AYear,
AMonth,
ADay,
AHour,
AMinute,
ASecond,
AMilliSecondSee also
- EncodeDateTime
- EncodeDateMonthWeek
- EncodeDateWeek
- EncodeDateDay
- DecodeDateWeek
- DecodeDateDay
- DecodeDateMonthWeek
Example: ex79
Program Example79;
{ This program demonstrates the DecodeDateTime function }
Uses SysUtils,DateUtils;
Var
Y,Mo,D,H,Mi,S,MS : Word;
TS : TDateTime;
Begin
DecodeDateTime(Now,Y,Mo,D,H,Mi,S,MS);
TS:=EncodeDateTime(Y,Mo,D,H,Mi,S,MS);
Writeln('Now is : ',DateTimeToStr(TS));
End.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
