<% dim searchcity, searchcountry, lat, lon, latNS, latdeg, latmin, lonEW, londeg, lonmin, tz, tzAhead, tzh, tzm, dst dim candles, tzaitdeg, tzaitmin if Request("submitSave")<>"" then ' save mode Session("City")=request("city") Session("Country")=request("country") Session("DSTRule")=request("dst") Session("Latitude")=request("latNS")*(request("latdeg")*60+request("latmin")) Session("Longitude")=request("lonEW")*(request("londeg")*60+request("lonmin")) Session("TimeZone")=request("tzAhead")*(request("tzh")*60+request("tzm")) Session("Candles")=request("candles") Session("TzaitDeg")=request("tzaitdeg") Session("TzaitMin")=request("tzaitmin") else ' initial entry searchcity=Session("City") searchcountry=Session("Country") lat=Session("Latitude") lon=Session("Longitude") tz=Session("TimeZone") dst=Session("DSTRule") candles=Session("Candles") tzaitdeg=Session("TzaitDeg") tzaitmin=Session("TzaitMin") latNS=1 ' 1=North if lat<0 then latNS=-1 lat=-lat end if latdeg=int(lat/60) latmin=lat mod 60 lonEW=1 ' 1=West if lon<0 then lonEW=-1 lon=-lon end if londeg=int(lon/60) lonmin=lon mod 60 tzAhead=1 if tz<0 then tzAhead=-1 tz=-tz end if tzh=int(tz/60) tzm=tz mod 60 end if %> <% if Request("submitSave")<>"" then %> Current city is now <%= session("City") %>.
<% else %>

Click on a city listed at the bottom of this page, and you will see its details (longitude, latitude etc) in the top section. If you want to use that city, press the "Save" button.
You can edit the exact settings to those you require (click "Save" afterwards).
It's often useful to change the city name before you save - for example you could save the settings with the name "London (Beth Din)".

City "") then %> <%= "VALUE=""" & searchcity & """" %> <% end if %> >
Country "") then %> <%= "VALUE=""" & searchcountry & """" %> <% end if %> >
Longitude MAXLENGTH="3" size="2">° MAXLENGTH="2" size="2">"
Latitude MAXLENGTH="2" size="2">° MAXLENGTH="2" size="2">"
Time zone MAXLENGTH="2" size="2">h MAXLENGTH="2" size="2">m
DST rule
<% 'Europe: last sun in Mar - last in Oct dim dd,mm,yy,DSTstart,DSTend dd=day(date) mm=month(date) yy=year(date) if mm>11 then yy=yy+1 DSTstart=dateserial(yy,3,31) DSTend=dateserial(yy,10,31) DSTstart=dateformat(DSTstart-((7+Weekday(DSTstart)-vbSunday) mod 7),1) DSTend=dateformat(DSTend-((7+Weekday(DSTend)-vbSunday) mod 7),1) response.write("European: " & DSTstart & " to " & DSTend &"
") DSTstart=dateserial(yy,4,7) DSTstart=dateformat(DSTstart-((7+Weekday(DSTstart)-vbSunday) mod 7),1) response.write("American: " & DSTstart & " to " & DSTend &"
") if mm<=6 then yy=yy-1 DSTstart=dateserial(yy,10,31) DSTend=dateserial(yy+1,3,31) DSTstart=dateformat(DSTstart-((7+Weekday(DSTstart)-vbSunday) mod 7),1) DSTend=dateformat(DSTend-((7+Weekday(DSTend)-vbSunday) mod 7),1) response.write("Southern: " & DSTstart & " to " & DSTend &"
") %> Candle lighting min before sunset
Tzait shabbat min after the sun is ° below the horizon



List of cities in the database:
<% Function WriteCities dim Conn, SQLQuery, List, hr, letter if Request("showCities")="All" then letter="" else letter = Request("showCities") end if Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "Driver={MySQL};DATABASE=consultdb; UID=consult;PASSWORD=jemima64" if letter="" then SQLQuery = "SELECT * FROM Locations order by city,country" else SQLQuery = "SELECT * FROM Locations where city like '" & letter & "%' order by city,country" end if Set List = Conn.Execute(SQLQuery) Do While Not List.EOF hr="javascript:SetParms('"& replace(List("city"),"'","\'") & "','" & List("country")& "'," &List("latitudeN")& "," &List("longitudeW")& "," &List("timeZone")& "," &List("DSTRule")&")" response.write "" & List("city") & ", " &List("country") & "
" List.MoveNext Loop List.Close Conn.Close end function call WriteCities %>
<% end if %>