Type your latitude, longitude, timezone and calculate your locally sunrise and sunset times.
function s(e){t=new Date;n=t.getFullYear();r=t.getMonth()+1;i=t.getDate();z=Math.floor(275*r/9)-Math.floor((r+9)/12)*(1+Math.floor((n-4*Math.floor(n/4)+2)/3))+i-30;o=90.83;u=Math.PI/180;k=180/Math.PI;f=G/15;l=e?z+(6-f)/24:z+(18-f)/24;y=.9856*l-3.289;h=y+1.916*Math.sin(y*u)+.02*Math.sin(2*y*u)+282.634;h=h>360?h-360:h<0?h+360:h;p=k*Math.atan(.91764*Math.tan(h*u));p=p>360?p-360:p<0?p+360:p;L=Math.floor(h/90)*90;R=Math.floor(p/90)*90;p=(p+(L-R))/15;sD=.39782*Math.sin(h*u);D=Math.cos(Math.asin(sD));H=(Math.cos(o*u)-sD*Math.sin(lt*u))/(D*Math.cos(lt*u));x=(e?360-k*Math.acos(H):k*Math.acos(H))/15;T=x+p-.06571*l-6.622;U=T-f;U=U>24?U-24:U<0?U+24:U;O=U+parseInt(Z);return(Math.floor(O)<10?"0"+Math.floor(O):Math.floor(O))+":"+(Math.floor(O*60%60)<10?"0"+Math.floor(O*60%60):Math.floor(O*60%60))}var t,n,r,i,z,o,u,k,f,l,y,h,p,L,R,D,H,x,T,U,O,G,lt,Z;G=prompt("latitude:",20.2667);lt=prompt("longitude:",46.65);Z=prompt("timezone:",1);c.font = '16pt Arial';c.fillText("Sunrise "+s(1)+", Sunset "+s(0),20,20)
ZnVuY3Rpb24gcyhlKXt0PW5ldyBEYXRlO249dC5nZXRGdWxsWWVhcigpO3I9dC5nZXRNb250aCgpKzE7aT10LmdldERhdGUoKTt6PU1hdGguZmxvb3IoMjc1KnIvOSktTWF0aC5mbG9vcigocis5KS8xMikqKDErTWF0aC5mbG9vcigobi00Kk1hdGguZmxvb3Iobi80KSsyKS8zKSkraS0zMDtvPTkwLjgzO3U9TWF0aC5QSS8xODA7az0xODAvTWF0aC5QSTtmPUcvMTU7bD1lP3orKDYtZikvMjQ6eisoMTgtZikvMjQ7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