I finally got mad that there isn't a simple way to find out whether it is daylight or not in OFP, so, here it is.
Basically, this baby will determine whether it's past sunrise/sunset or not.
I'm sure it has 1000 uses, but I made it because I have a SAR mission that I need the pilot to be rescued and he needs to launch a flare at night, or smoke in day.
Some of the days may need to be tweaked so that it fits OFP better, but assuming my calculations are right, 6AM/6PM Sunrise/Sunset on the Equinoxes with 2:30 total (1:15 each side of sunrise/sunset) during the Solstaces.
Enjoy!
;Header Information
_days = 0
_month = missionStart select 2
_day = missionStart select 3
_hour = daytime
_month = _month - 1
;Determine Day of the Year
#MonthLoop
?(_month == 0):goto "LoopEnd"
_dayssofar = _days
;30 days has SEP, APR, JUN, & NOV :)
?(_month == 2):_days = _days + 28
?(_month == 9) OR (_month == 4) OR (_month == 6) OR (_month == 11):_days = _days + 30
?(_dayssofar == _days):_days = _days + 31
_month = _month - 1
goto "MonthLoop"
#LoopEnd
;Day of the Year Calculation
_dayofyear = _days + _day
;Calculate days from an equinox
_equinox = 0
?(_dayofyear < 80):_equinox = _dayofyear - 80
?(_dayofyear > 80):_equinox = _dayofyear - 80
?(_dayofyear > 172):_equinox = 265 - _dayofyear
?(_dayofyear > 265):_equinox = 265 - _dayofyear
?(_dayofyear > 356):_equinox = _dayofyear - 445
;Calculate Sunrise/Sunset
_sunrise = ((_equinox * -.013889) + 6)
_sunset = ((_equinox * .013889) + 18)
;Change stuff below to suit...examples listed.
if (_hour < _sunrise) OR (_hour > _sunset) then {hint "It's Dark!"} else {hint "It's Light!"}