22.09.2017, 10:24
You can use rscalc function from common functions to get sunrise and sunset time in minutes. Then you can convert it to text (or use a day/time object instead):
Code:
latitude = 11.11
longitude = 22.22
sunrise, sunset = rscalc(latitude, longitude)
sunrise_hour = math.floor(sunrise / 60)
sunrise_minute = sunrise % 60
sunset_hour = math.floor(sunset / 60)
sunset_minute = sunset % 60
sunrise_text = string.format('%02d:%02d', sunrise_hour, sunrise_minute)
sunset_text = string.format('%02d:%02d', sunset_hour, sunset_minute)