Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Datediff/suntime question... Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
bhlonewolf
Senior Member
Senior Member


Joined: March 29 2007
Online Status: Offline
Posts: 198
Posted: November 04 2007 at 18:22 | IP Logged Quote bhlonewolf

For kicks I was playing around with calculating some dusk/sunset stuff (in this case, minutes between sunset and dusk), but running into some issues. I wrote the following to calculate the difference, but no matter what I do, I get the same result:

ph_secondsafter(
     ph_getsuntime( date("12-21-2007"), 2),
     ph_getsuntime( date("12-21-2007"), 4)
     ) / 60

I can limit the problem to this:

ph_getsuntime( date("12-21-2007"), 2)

When I call ph_getsuntime and pass in today(), it works, but when I try passing in a date("") as shown above, I always get the same result returned. So, if I pass in 6 instead of 12 for the month, I get sunset of just after 5pm, etc. Am I doing something wrong here? The date() function seems to work fine, so either I'm doing something wrong or there's something up with ph_getsuntime ... thx!

Brian


Edited by bhlonewolf - November 04 2007 at 18:26
Back to Top View bhlonewolf's Profile Search for other posts by bhlonewolf
 
jbbtex
Senior Member
Senior Member


Joined: February 15 2007
Location: United States
Online Status: Offline
Posts: 181
Posted: November 04 2007 at 23:54 | IP Logged Quote jbbtex

Try this:

ph_getsuntime(datetime("12-21-2007"), 2)

__________________
Brady

"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity." - Gen. George S. Patton
Back to Top View jbbtex's Profile Search for other posts by jbbtex
 
bhlonewolf
Senior Member
Senior Member


Joined: March 29 2007
Online Status: Offline
Posts: 198
Posted: November 05 2007 at 00:22 | IP Logged Quote bhlonewolf

Ha! Thanks!

Sad part is I thought about trying another date function but thought, nope, that's not it -- date() should work! :)

Thanks for the help!

Brian
Back to Top View bhlonewolf's Profile Search for other posts by bhlonewolf
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum