|
|
|
|
DOWNLOAD THE SOLARTIME LIBRARY! Download Steps For SolarTime Library (V5R3M0 or Later)
|
Get the Sunrise, Sunset, and Solar Noon times for any given day for practically any place on Earth! The Solar_s service program will calculate the sunrise, sunset, and solar noon times for any given day for practically any place on Earth. ( Places that reside above 70degrees latitude or below -70degrees latitude will not be accurate.) The service program can also calculate the length of the day for a given date. The following is a sample call to calculate the sunrise time: SunRiseTime
= Solar_GetSunriseTime( SunRiseDate
The sunrise and sunset functions require 5 parameters. SunRiseDate: The date to calculate the sunrise for. Longitude: The longitude of the location in decimal form. See the latitiude section above on how to convert a longitude in degrees and minutes into decimal form. HourOffset: This is the value, in hours, of the difference between the local time and Greenwich Mean Time. For example, the HourOffset for New York City is 5. For Beijing, China, it is -8. For London, England it is Zero. DayLightSavings: This parameter states whether or not daylight savings time is in effect. The default is no. If daylight savings time is in effect for the area you are calculating, then set the DayLightSavings field to *on. The solar functions will not be accurate for the polar regions. (ie latitudes greater than or +70 or less than -70 degrees.) This is because I wanted these functions to return only a time. In the polar regions, some days will not have a sunrise, and some days will not have a sunset. For example, on June 10th, 2009, sunrise for the location of +80 latitude and +90 longitude does not occur on June 10th. In fact, sunrise would have occurred all the way back on April 12th. Sunset will not occur until August 30th. If we change the date to December 10th, 2009, then sunrise will occur on Feb 20, 2010. Sunset will not occur again until late August, 2010. The prior sunset for this date was October 20th, 2009. Therefore, these functions would need to return a timestamp in order to reflect the actual sunrise and sunset times for a given date in the polar regions. (The calculations would also need to be modified a bit as well.) Since I only wanted to return a time value, and since I really don't need the sunrise and sunset times for polar regions, I have set up these functions so that they are accurate only to +-70 degrees latitude or so.
If you execute the SolarTime program, you will receive a screen that looks similar to the one below. ( Use the download steps on the left hand side of this page. Add the SolarTime library to your library list, then CALL SOLARTIME If you want to see the sunrise and sunset times for your local area, then lookup the latitude and longitude values for your area. Remember that these value must be in decimal form. Also, you will need to find the Time Offset from the Greenwich meant time for you area. The eastern time zone for the US is typically 5, the central time zone is 6, the mountain time zone is 7, and the pacific time zone is 8.
Functions In This Service Program The Solar_s service program contains the following functions:
|