Page 1 of 1
Sunset/Sunrise times
Posted: Mon Apr 03, 2006 11:02 pm
by Digit
Hi,
Does anybody know a good resource for calculating sunset/sunrise times ?
My ultimate goal is to have some kind of source that i can query periodically to fill my local SQL table with, or have some algorithm that can calculate those times for me.
I have found some websites that can calculate them for me, but typing them over is an option i am not willing to consider yet.
Sunset/Sunrise times
Posted: Mon Apr 03, 2006 11:11 pm
by Bwired
Hi Digit
Here is some Visual Basic 6 code which calculates the Sunrise and sunset, it makes a table for the whole year. You have to program a bit for putting it in a SQL table. I have some other code as well but you have to run that daily so not attached.
Regards
Pieter
<b>Download Attachment:</b>
[img]images/icon_paperclip.gif[/img] Sunrise_sunset.zip<br />7.03 KB
www.bwired.nl Online Domotica, Home Automation house.
Sunset/Sunrise times
Posted: Mon Apr 10, 2006 11:48 pm
by Digit
Hi Pieter,
Thanks for the VB code. However, after some more searching i found another source in Javascript that was easier to rewrite to Delphi (my favorite language) for me. It can calculate civil, nautical and astronomical sunrise/sunset times for any given location and date. It's almost finished now. If anyone is interested, just let me know.
Digit
Sunset/Sunrise times
Posted: Tue Apr 11, 2006 12:04 am
by Bwired
Hi Digit,
Yes please put it on the board!
I am a VB guy, but I can always learn from it and see how its done.
Do you have the java link as well?
Thanks
Pieter
www.bwired.nl Online Domotica, Home Automation house.
Sunset/Sunrise times
Posted: Tue Apr 11, 2006 12:25 am
by Digit
Well, my Delphi code works but contains too much debugging code yet and needs some extra OO-related work to be done. I'll clean it up a bit and then i'll post it. This can take some days cause my time is a bit limited...
The source I used:
http://www.meteonet.nl/diversen/zoncalc.htm
Digit
Sunset/Sunrise times
Posted: Sat Aug 26, 2006 2:45 pm
by Digit
Hi,
Sorry, no Domotica time for me in the last months..
Here's my contribution to calculating Sunrise/sunset calculations i mentioned in a previous post. It's written in Delphi, the code contains no comment, and i just added a little form today with a DateTimePicker to check the results a bit easier.
There's no Timezone/Daylight Saving correction yet, and you'll have to change latitude and longitude (see Unit1) to get the right results!
uploaded/Digit/2006826144438_zoncalc.zip