08.10.2021, 07:32
You can use a scheduled script that runs daily at some time close to midnight.
This example adds 1 hour to the current time and checks the day number. If it is 1 it means that the current day is the last day of the month.
This example adds 1 hour to the current time and checks the day number. If it is 1 it means that the current day is the last day of the month.
Code:
date = os.date('*t', os.time() + 3600) -- 1 hour from now
if date.day == 1 then
-- do something
end