Javascript fot the sunrise and the sunset

K

kaeli

For a given town I search a javascript that gives the hour of the sunset and
the sunrise.
Looks simple but not found up to now on the net

No, it's nothing close to simple.
That's meteorological data that changes daily and would not be quite the same
over years. If you actually had all that data in a database, you'd still need
a server-side script to retrieve it (not client-side javascript).

I'd look into a web service from a national agency that keeps track of these
things or some other provider. My guess is that's where such data would
normally come from (i.e. Excite.com's section that has such data). I would
not attempt to keep such data in a DB myself unless the towns I kept track of
numbered less than 10. Even then I'd probably go find it somewhere else.
That'd be hell to keep updated.

For example:
http://ws2.serviceobjects.net/fw/FastWeather.asmx?op=GetWeatherByCityState

--
 
E

Evertjan.

Andrew Urquhart wrote on 05 aug 2004 in comp.lang.javascript:
Can't help you with the "placename to longitude and latitude" conversion
but you could convert Roger Sinnotts 'cheap and cheerful', 'tried and
tested' Sunup.bas to javascript yourself <URL:
http://skyandtelescope.com/resources/software/programs/sunup.bas> (info:
<URL: http://skyandtelescope.com/resources/software/article_326_1.asp>)
or I can dig out an old conversion I did myself that I have archived
away.

Try this from Steve P. Morse:

<http://www.stevemorse.org/jcal/sunrise.html>

The javascripts are:
city-us.js
city-ca.js
city-xx.js
sunrise.js
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top