13.07.2015, 20:21
Hi Roger,
my version is a little more basic, what do you think :
longitude and latitude are fixed and there is no offset.
For those who search for the timezone setting, it's in Utilities > Date and time
Matthieu
my version is a little more basic, what do you think :
Code:
-- answer if we have the sun shining
function sun_is_up()
local longitude = *****
local latitude = ****
local now = os.date('*t')
local now_calc = now.min + now.hour*60
local sunrise, sunset = rscalc(latitude, longitude)
local result = (now_calc>(sunrise)) and (now_calc<(sunset))
return result
end
longitude and latitude are fixed and there is no offset.
For those who search for the timezone setting, it's in Utilities > Date and time
Matthieu