Sunset/Sunrise times

Forum regarding Windows Software and Home Automation Domotica.

Sunset/Sunrise times

Postby Digit » Mon Apr 03, 2006 10:02 pm

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. ;-)
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Sunset/Sunrise times

Postby Bwired » Mon Apr 03, 2006 10:11 pm

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> [url="/uploaded/bwired/200643231030_Sunrise_sunset.zip"][img]images/icon_paperclip.gif[/img] Sunrise_sunset.zip[/url]<br />7.03 KB

www.bwired.nl Online Domotica, Home Automation house.
User avatar
Bwired
Administrator
Administrator
 
Posts: 5304
Joined: March 2006
Location: Netherlands

Sunset/Sunrise times

Postby Digit » Mon Apr 10, 2006 10:48 pm

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
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Sunset/Sunrise times

Postby Bwired » Mon Apr 10, 2006 11:04 pm

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.
User avatar
Bwired
Administrator
Administrator
 
Posts: 5304
Joined: March 2006
Location: Netherlands

Sunset/Sunrise times

Postby Digit » Mon Apr 10, 2006 11:25 pm

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
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Sunset/Sunrise times

Postby Digit » Sat Aug 26, 2006 1:45 pm

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!

[url]uploaded/Digit/2006826144438_zoncalc.zip[/url]
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands


Return to Windows Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron