From Clomosy Docs
No edit summary |
No edit summary |
||
| Line 9: | Line 9: | ||
'''Example:'''<br> | '''Example:'''<br> | ||
:'''Base Syntax''' | |||
var | |||
myDate : TclDateTime; | |||
begin | |||
// Set my date variable using the EncodeDate function | |||
myDate := '''EncodeDate'''(2023, 02, 27); | |||
ShowMessage('Date set to '+DateToStr(myDate)); | |||
end; | |||
:'''TRObject Syntax''' | |||
var | |||
myDate : TclDateTime; | |||
{ | |||
// Set my date variable using the EncodeDate function | |||
myDate = '''EncodeDate'''(2023, 02, 27); | |||
ShowMessage('Date set to '+DateToStr(myDate)); | |||
} | |||
'''Output:'''<br> | '''Output:'''<br> | ||
Date set to 27.02.2023 | Date set to 27.02.2023 | ||
Revision as of 11:30, 13 February 2024
function EncodeDate(const Year, Month, Day Word):TclDateTime;
The EncodeDate function produces a TclDateTime return value from the passed Year, Month, and Day values.
The allowed parameter values are:
Year = 2000..9999
Month = 1..12
Day = 1..31 (depending on month/year)
Example:
- Base Syntax
var
myDate : TclDateTime;
begin
// Set my date variable using the EncodeDate function
myDate := EncodeDate(2023, 02, 27);
ShowMessage('Date set to '+DateToStr(myDate));
end;
- TRObject Syntax
var
myDate : TclDateTime;
{
// Set my date variable using the EncodeDate function
myDate = EncodeDate(2023, 02, 27);
ShowMessage('Date set to '+DateToStr(myDate));
}
Output:
Date set to 27.02.2023