Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate sunrise and sunset time for current date with Delphi

I need to determine sunrise and sunset times (local time) for the current day given a specific latitude and longitude and using Delphi (I am using XE2). I've found this article and used the SysTools library but the results do not agree with published tables for the UK.

Has anyone seen a pascal algorithm for this?

like image 748
Brian Frost Avatar asked Dec 23 '11 12:12

Brian Frost


People also ask

How are sunrise and sunset times calculated?

How are the times of sunset and sunrise determined? A. Sunset and sunrise have exactly the same definition: the time when the apparent uppermost ray of the Sun is on the astronomical horizon. If it is the first ray, it is sunrise and if it is the last ray, it is sunset.

Is sunset calculation time accurate?

The angles are accurate to about 0.5 degrees (the Sun's diameter), except when the Sun is at the horizon where the accuracy decreases slightly due to atmospheric refraction, which is not taken into account in these calculations.

How do you measure sunrise?

"Sunrise and sunset conventionally refer to the times when the upper edge of the disk of the Sun is on the horizon, considered unobstructed relative to the location of interest.


1 Answers

Some random sites:

  • SunTime Component
  • Torry's Delphi Pages
like image 181
menjaraz Avatar answered Sep 18 '22 09:09

menjaraz