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.

different value throughout the day
#14
You can convert current time to a number of minutes passed since 0:00 and use it in your calculations. Use this example to check if current time is between 5:30 and 10:00
Code:
function tominutes(h, m)
  return h * 60 + m
end

now = os.date('*t')
mins = tominutes(now.hour, now.min)

if mins >= tominutes(5, 30) and mins <= tominutes(10, 0) then
  -- do something here
end
Reply


Messages In This Thread
RE: different value throughout the day - by admin - 06.04.2021, 05:40

Forum Jump: