This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Next day (os.date)
#2
You can simply add +1 to day number, convert to timestamp, then get a date from that timestamp. It handles year/month wrap-around automatically.
Code:
date = os.date('*t') -- current date (table)
date.day = date.day + 1 -- add 1 day
time = os.time(date) -- convert to timestamp
date = os.date('*t', time) -- tomorrow date (table) from timestamp
log(date)
Reply


Messages In This Thread
Next day (os.date) - by FatMax - 21.03.2022, 10:02
RE: Next day (os.date) - by admin - 21.03.2022, 10:11
RE: Next day (os.date) - by FatMax - 21.03.2022, 10:12
RE: Next day (os.date) - by admin - 21.03.2022, 13:49

Forum Jump: