Re: pw_images, UTC, TimeZones, LocalTime
Brought to you by:
iridium
From: Phil P. <phi...@sw...> - 2004-02-03 20:56:15
|
A little trolling around on the web found me THIS interesting chunk of PHP code: http://www.zend.com/codex.php?id=135&single=1 Specificallly, an implementation of calculating sunrise and set from LAT+LONG+GMT Offset Enjoy, Phil P Martin Geisler wrote: > Phil Pierotti <phi...@sw...> writes: > > >>Realistically, for this to be complete and flexible, each ICAO will >>need the following information: >> - TimeZone specified as offset from GMT >> - uses Daylight Savings? >> - DST start date >> - DST end date >> - latitude & longitude >> >>The sunrise and sunset times can be calculated from the information >>from NOAA http://www.srrb.noaa.gov/highlights/sunrise/calcdetails.html > > > Thanks a lot for that link --- we've made an attempt to implement this > kind of functionality before, but when I searched the net I only found > some messy algorithms that I didn't have much luck with, see > > http://makeashorterlink.com/?T162215A2 > > The information on the above page looks much clearer, and it should be > easy to port the JavaScript code to PHP --- those two languages are > very much alike. > > >>Lat and Long can be had for ICAOs from >>http://weather.noaa.gov/tg/site.shtml directly -> >>http://weather.noaa.gov/data/nsd_cccc.txt > > > Thanks again --- I've found those datafiles before, but the > information is still not part of PHP Weather. Given the latitude and > longitude it should be possible to calculate an approximate timezone. > > And with that timezone we should be able to give a local time for the > reports, but I guess it will still be off by +/- 1 hours depending on > daylight saving time, so I don't know how good that idea is. > > It's just that the real solution: attaching detailed information about > the daylight saving time to each station, sounds like a difficult > task. But then again, there must be some tables with this information > somewhere on every system, so perhaps it's doable? > > > In any case --- I'm having my exams right now! The first one will be > on Wednesday, so I wont start playing with this stuff now, but if > someone else feels like it, then by all mean do! I can add people to > the project as developers if they believe they need CVS access. > |