Instead of looking at the current time, I think that it's better to check the altitude of the sun: when it's 15 degrees below the horizon then it's surely night.
A possible implementation would be: (remember to change the longitude/latitude of your observatory)
Code: Select all
myLon = 12 ' positive if East
myLat = 44 ' North
al = SunAlt
if al < -15 then
print al; "= nighttime"
else
print al; "= daytime"
end if
sub SunAlt
ra,de = SunRaDec(JD)
az,al = EquatToAltaz(ra,de,myLon,myLat,JD)
return al
end sub