PHP Developers Network
http://forums.devnetwork.net/

get_sunset() problems
http://forums.devnetwork.net/viewtopic.php?f=1&t=75297
Page 1 of 1

Author:  heritage [ Thu Oct 25, 2007 1:33 pm ]
Post subject:  get_sunset() problems


Author:  churt [ Thu Oct 25, 2007 2:45 pm ]
Post subject:  function or class


Author:  heritage [ Thu Oct 25, 2007 4:16 pm ]
Post subject: 


Author:  churt [ Tue Oct 30, 2007 2:55 pm ]
Post subject:  Weekend

Sorry I did not get back sooner. Went on vacation and had no access to play with code.

It gets tricky using a date but just make sure that you preface all date references with strtotime().

This code worked fine for me.
Syntax: [ Download ] [ Hide ]
echo date_sunset(strtotime('2007-10-25 10:01'), SUNFUNCS_RET_STRING, 41.98, -87.90,90.83,-5);


When I use 41.9897 and -87.7014 I get 17:54. I could live with that but the ones I used above give me 17:55. I took them from Chicago/O'hare,IL.

I had issues using
Syntax: [ Download ] [ Hide ]
date('Y-m-d', '2007-10-25')


When I used
Syntax: [ Download ] [ Hide ]
strtotime(date('Y-m-d', strtotime('2007-10-25'))
it worked fine.

I then realized that was redundant and shortened it to
Syntax: [ Download ] [ Hide ]
strtotime('2007-10-25')


Hope this helps.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/