help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'sysutils' (#rtl)

EncodeDate

Encode a Year,Month,Day to a TDateTime value.

Declaration

Source position: datih.inc line 103

function EncodeDate(

  Year: Word;

  Month: Word;

  Day: Word

):TDateTime;

Description

EncodeDate encodes the Year, Month and Day variables to a date in TDateTime format. It does the opposite of the DecodeDate procedure.

The parameters must lie withing valid ranges (boundaries included):

Year
must be between 1 and 9999.
Month
must be within the range 1-12.
Day
msut be between 1 and 31.

Errors

In case one of the parameters is out of it's valid range, an EConvertError exception is raised.

See also

EncodeTime

  

Encode a Hour,Min,Sec,millisec to a TDateTime value.

DecodeDate

  

Decode a TDateTime to a year,month,day triplet

Example

Program Example11;

{ This program demonstrates the EncodeDate function }

Uses sysutils;

Var YY,MM,DD : Word;

Begin
  DecodeDate (Date,YY,MM,DD);
  WriteLn ('Today is : ',FormatDateTime ('dd mmmm yyyy',EnCodeDate(YY,Mm,Dd)));
End.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505