%@ EnableSessionState=false Language=JavaScript %>
<%
check_cookie();
function getDaysInMonth(month,year)
{
var days;
if (month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12)
{ days=31; }
else if (month==4 || month==6 || month==9 || month==11)
{ days=30; }
else if (month==2)
{
if (isLeapYear(year))
{ days=29; }
else
{ days=28; }
}
return (days);
}
function isLeapYear(Year)
{
if (((Year % 4)==0) && ((Year % 100)!=0) || ((Year % 400)==0))
{ return (true); }
else
{ return (false); }
}
var server_date;
server_date = new Date();
local_date = new Date(server_date.getTime() + (Number(Request.Cookies("UserData")("Timezone")) * 60*60*1000));
this_year = local_date.getUTCFullYear() + 0;
this_month = local_date.getUTCMonth() + 1;
//today = local_date.getUTCDate() + 0;
//now_hr = local_date.getUTCHours() + 0;
//now_min = local_date.getUTCMinutes() + 0;
//now_sec = local_date.getUTCSeconds() + 0;
if ((isFinite(Request.Form("m")) == true) && (Request.Form("m") > 0) && (Request.Form("m") <= 12))
{ data_month = Request.Form("m"); }
else
{ data_month = this_month; }
if ((isFinite(Request.Form("y")) == true) && (Request.Form("y") > 1900) && (Request.Form("y") <= 2100))
{ data_year = Request.Form("y"); }
else
{ data_year = this_year; }
Response.write("\n");
days = getDaysInMonth(data_month, data_year)
%>
<% insert_menu(0); %>
<% title_block("local sunrise & sunset", "the sun"); %>
|
|
|
Note: If you select a month that differs from your current daylight
time setting, the rise and set times will not be corrected. For
example, if you are currently in standard time and you select a
month when you would be in daylight time, you will have to add
one hour to the times shown.
|
date

sunrise time
sunrise azimuth

sunset time
sunset azimuth
|
|
| Sun |
Mon |
Tue |
Wed |
Thu |
Fri |
Sat |
<%
thefirst = new Date(data_year, data_month - 1, 1)
skip = thefirst.getDay();
for (i = 0; i < skip; i++)
{
Response.write("| | \n");
}
for (today = 1; today <= days; today++)
{
ob = obliquity(data_year, data_month, today);
sundata_riset = sun(data_year, data_month, today, 12, 0, 0);
sundata_current = sun(data_year, data_month, today, server_date.getUTCHours(),
server_date.getUTCMinutes() + 1, server_date.getUTCSeconds());
sunradec_current = ecltoequ(sundata_current[0], 0, ob);
sunradec_riset = ecltoequ(sundata_riset[0], 0, ob);
srs = riset(sunradec_riset[0], sunradec_riset[1], Number(Request.Cookies("UserData")("Latitude")));
Response.write("" + String(today) + " \n");
Response.write(" \n");
if (srs[0] == 99)
Response.write("Does not set
");
else if (srs[0] == -99)
Response.write("Does not rise
");
else
{
trise = hourstohms(normalize24(lsttogmt(data_year, data_month, today,
Number(Request.Cookies("UserData")("Longitude")), srs[0]) + Number(Request.Cookies("UserData")("Timezone"))));
trise12hr = to12(trise[0]);
Response.write(trise12hr[0] + ":" + leadingzero(trise[1]) + ":" + leadingzero(trunc(trise[2])) + " " + trise12hr[1] + " ");
Response.write(degtodmsstr(srs[1]) + " ");
Response.write(" \n");
tset = hourstohms(normalize24(lsttogmt(data_year, data_month, today,
Number(Request.Cookies("UserData")("Longitude")), srs[2]) + Number(Request.Cookies("UserData")("Timezone"))));
tset12hr = to12(tset[0]);
Response.write(tset12hr[0] + ":" + leadingzero(tset[1]) + ":" + leadingzero(trunc(tset[2])) + " " + tset12hr[1] + " ");
Response.write(degtodmsstr(srs[3]));
}
Response.write(" | \n");
if ((today + skip) % 7 == 0)
{
Response.write(" \n\n");
}
}
%>
|
|
|
<% insert_footer(); %>
|
|