I am trying to use get_sunset function and having the following problems:
1. why when I use time() parameter it shows different result then when I use date('Y-m-d') ? Shouldn't sunset be the same time during the whole day??
2. I took the information for chicago from the reliable chart: $lat = 41.9897; $lng = -87.7014; but it doesn't show me the same result. I mean the minutes part is wrong, so offset has nothing to do with it. For example 2007-10-25 sunset should be 17:55, but I cannot get such time.
3. I tried using different zenith, but doesn't help.
Any ideas?
get_sunset() problems
Moderator: General Moderators
function or class
Are you perhaps referring to date_sunset?
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.
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
When I used it worked fine.
I then realized that was redundant and shortened it to
Hope this helps.
It gets tricky using a date but just make sure that you preface all date references with strtotime().
This code worked fine for me.
Code: Select all
echo date_sunset(strtotime('2007-10-25 10:01'), SUNFUNCS_RET_STRING, 41.98, -87.90,90.83,-5);I had issues using
Code: Select all
date('Y-m-d', '2007-10-25')Code: Select all
strtotime(date('Y-m-d', strtotime('2007-10-25'))I then realized that was redundant and shortened it to
Code: Select all
strtotime('2007-10-25')