PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Dec 05, 2019 8:24 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: get_sunset() problems
PostPosted: Thu Oct 25, 2007 1:33 pm 
Offline
Forum Newbie

Joined: Thu Oct 25, 2007 1:21 pm
Posts: 2


Top
 Profile  
 
 Post subject: function or class
PostPosted: Thu Oct 25, 2007 2:45 pm 
Offline
Forum Commoner
User avatar

Joined: Wed Oct 04, 2006 9:59 am
Posts: 39


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 25, 2007 4:16 pm 
Offline
Forum Newbie

Joined: Thu Oct 25, 2007 1:21 pm
Posts: 2


Top
 Profile  
 
 Post subject: Weekend
PostPosted: Tue Oct 30, 2007 2:55 pm 
Offline
Forum Commoner
User avatar

Joined: Wed Oct 04, 2006 9:59 am
Posts: 39
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group