Code posted by: elf on 2014-08-19 16:42:08 GMT+10 - type PHP
  1. <?php
  2. //seatle rise + set
  3. $lat = 47.6097;
  4. $lon = -122.3331;
  5. $offset = -7; //seattle is normally -8, but they're observing daylight saving right now so it needs to be - RECOMMENDED: use something like get_timezone_offset() to automatically calculate this based on a current timezone database
  6. $zenith = 90+(50/60);
  8. echo 'rise: '.date_sunrise(time(), SUNFUNCS_RET_STRING, $lat, $lon, $zenith, $offset).'<br>';
  9. echo 'set: '.date_sunset(time(), SUNFUNCS_RET_STRING, $lat, $lon, $zenith, $offset);

New post:
Respond to the original code above (post ID femxrja)? Yes (click here to paste the code from above), or click here to make a new post.

Syntax highlighting?
Name (blank for Anonymous)
How long to keep it for?
Type the above security code:

© 2006-2008 and
Site design and code mostly developed by elf (with the exception of GeSHi of course).
Hits: 319562