MyChat Scripts Engine: EndOfTheMonth
Function to obtain the date/time value of the end of the month from the specified date.
Syntax
function EndOfTheMonth(dt: double): double;
Parameters and return values
Parameter |
Type |
Value |
dt |
double |
source date/time value. |
Function result
Date/time value that represents the last second of the last day of the month.
Example
var
dt, dtNow: double;
begin
dtNow := Now;
dt := EndOfTheMonth(dtNow);
mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss', dtNow), 'Now');
mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss', dt), 'EndOfTheMonth');
end.
Script work result
[18:30:07] (Log "EndOfTheMonth"): [Now] 12.13.2016 18:30:07
[18:30:07] (Log "EndOfTheMonth"): [EndOfTtheMonth] 12.31.2016 23:59:59
[18:30:07] (Run "EndOfTheMonth"): Script operation time: 5 ms
[18:30:07] (Run "EndOfTheMonth"): Script done successfully.