MyChat Scripts Engine: DecodeDate
Function to obtain the year, month and day values from the date/time value.
Syntax
procedure DecodeDate(dt: double; var wYear, wMonth, wDay: word);
Parameters and return values
Parameter |
Type |
Value |
dt |
double |
date/time value; |
wYear |
word |
return value, year; |
wMonth |
word |
return value, month; |
wDay |
word |
return value, day. |
Function result
Year, month, and day values that correspond to the specified date.
Example
var
wYear, wMonth, wDay: word;
begin
DecodeDate(Now, wYear, wMonth, wDay);
mLogScript(' Year: ' + inttostr(wYear), '');
mLogScript('Month: ' + inttostr(wMonth), '');
mLogScript(' Day: ' + inttostr(wDay), '');
end.
Script work result
[14:35:30] (Log "DecodeDate"): Year: 2016
[14:35:30] (Log "DecodeDate"): Month: 2
[14:35:30] (Log "DecodeDate"): Day: 23