Function to obtain the date/time value of the start of the month from the specified date.
function StartOfTheMonth(dt: double): double;
Parameter |
Type |
Value |
---|---|---|
dt |
double |
source date/time value. |
Date/time value of the start of the month.
var
dt, dtNow: double;
begin
dtNow := Now;
dt := StartOfTheMonth(dtNow);
mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss', dtNow), 'Now');
mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss', dt), 'StartOfTheMonth');
end.
[19:36:56] (Log "StartOfTheMonth"): [Now] 12.12.2016 19:36:56
[19:36:56] (Log "StartOfTheMonth"): [StartOfTheMonth] 01.12.2016 00:00:00
[19:36:56] (Run "StartOfTheMonth"): Script operation time: 5 ms
[19:36:56] (Run "StartOfTheMonth"): Script done successfully.