[jonah] Re: Sun Rise / Set Problem

Ruben van der Steenhoven ruben_donotspamme at webmeesters.nl
Wed Apr 16 01:50:09 PDT 2003


One final thing Jeff,

i might be interested in creating one of the blocks myself, but i can't 
seem to find out where to register the block so i can add it to horde. 
My first guess was registry.php, but that doesn't seem the right place, 
can you tell me where, or point me at some docs on these block-functions?

Thanks again!

Ruben van der Steenhoven.

Jeff Graves wrote:
> I'm guessing it's something to do with this function on your system:
> 
> return strftime('%X', mktime($hour, $min, $sec, $mon, $mday, $year));
> 
> I'm using PHP 4.3.0 Zend engine 1.3.0 and I just tried the Volkel
> Airport and it returned:
> 
> Date: 1050427779
> YDay: 104 Mon: 4 MDay: 15 Year: 2003 DST: 1 TZ: -4
> Lat: 51.650 Long: 5.700
> 
> 00:44:18
> 14:31:50
> 
> Check it by modifying the return at the end to return the values of
> the variables instead of passing them to mktime:
> 
> +>	$returnVal = $hour . ':' . $min . ':' . $sec . ':' . $mon . ':' .
> $mday . ':' . $year;
> 
>         //return strftime('%X', mktime($hour, $min, $sec, $mon, $mday,
> $year));
> +>	return $returnVal;
> 
> See what you get. If you get something other than 12:00:00 and
> 00:00:00 then the problem is in the return statement. If you still get
> those bogus values, then something's wrong in the calculation.
> 
> Jeff Graves
> Customer Support Engineer
> Image Source, Inc.
> 10 Mill Street
> Bellingham, MA 02019
> 
> jeff at image-src.com - Email
> 508.966.5200 X31 - Phone
> 508.966.5170 - Fax
> 
> -----Original Message-----
> From: jonah-bounces at lists.horde.org
> [mailto:jonah-bounces at lists.horde.org]On Behalf Of Ruben van der
> Steenhoven
> Sent: Tuesday, April 15, 2003 12:17 PM
> To: jonah at lists.horde.org
> Subject: [jonah] Re: Sun Rise / Set Problem
> 
> 
> Yep, when i changed over to Mexico these were the values that went
> into
> calcSunset:
> 
> Date: 1050423293
> YDay: 104 Mon: 4 MDay: 15 Year: 2003 DST: 1 TZ: 2
> Lat: 25.867 Long: -100.233
> 
> and returned:
> Rise: 12:00:00 Set: 00:00:00
> 
> the date on my server is correct as you can see, even worse, it's
> synchronised to a NTP-server...
> I am baffled, the formula in calcSunset is just a bit to steep for me
> to
> delve into quickly
> 
> Oh yes, i use exactly the same version as you do...
> 
> Jeff Graves wrote:
> 
>>I assume that when you changed locations to Mexico, the results code
>>fragment you added were different? Can you check the values returned
>>by calcSunset? It seems kind of odd that it would always return
>>12:00:00 and 00:00:00 since it's a mathimatical function (you've
>>probably already done this but is the date correct on your server?).
>>And just so we're on the same page:
>>
>>* $Horde: jonah/lib/Block/sunrise.php,v 1.6 2003/02/08 12:06:04 jan
>>Exp $
>>
>>is what I'm using.
>>
>>Jeff Graves
>>Customer Support Engineer
>>Image Source, Inc.
>>10 Mill Street
>>Bellingham, MA 02019
>>
>>jeff at image-src.com - Email
>>508.966.5200 X31 - Phone
>>508.966.5170 - Fax
>>
>>-----Original Message-----
>>From: jonah-bounces at lists.horde.org
>>[mailto:jonah-bounces at lists.horde.org]On Behalf Of Ruben van der
>>Steenhoven
>>Sent: Tuesday, April 15, 2003 10:06 AM
>>To: jonah at lists.horde.org
>>Subject: [jonah] Re: Sun Rise / Set Problem
>>
>>
>>I didn't do that in the config files. I just selected the nearest
>>airport  in the Block options of the sunset block. (This was of some
>>help, because of your question i had to retrace my steps to find out
>>that i COULD change the location without bothering other Horde
>>components after all). Now i also tried some other locations like
>>Mexico
>>and Amsterdam, but with all the same results.
>>
>>I've added following code to the _content function of
>>jonah/lib/Block/sunrise.php to find the values i mentioned: (BTW:
> 
> That
> 
>>date format you mentioned is the tandard UNIX-internal date format.)
>>
>>
> 
> 
> 
> 
> --
> Jonah mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: jonah-unsubscribe at lists.horde.org
> 
> 




More information about the jonah mailing list