Depending on your application, the approach you take to solve your problem could differ.
For a changeable lattitude, longitude, Height above sea level, DST the calculation is not trivial. The astronomical calculations used require double precision (15digits floating point) math to get accurate results.
If your location is fixed, then perhaps a table driven approach with corrections applied to the table for different dates of the year may work - I am not sure of this.
You may find C code for the calculations if you search for such calculations.
IMO : this is most certainly not easy to undetake in PicBasic.
Bookmarks