Graphic sun position

Oh crikey, perhaps it might be best to hear from Pinto on this one lol

Think so, too. :wink:

it’ the timezone-setting
It’s not in there
add

$SITE['TZ'] = "US/Mountain";
    set_tz( $SITE['TZ'] );
function set_tz ($TZ){
    if (phpversion() >= "5.1.0") {
        date_default_timezone_set($TZ);
    } else {
        putenv("TZ=" . $TZ);
    }
}

after

<?php

adjust $SITE[‘TZ’]= for your location

$diffUTC=date("O",time())/100;

~~>see here

it is the letter O

EDIT:sorry, I don’t need it, because my server is in my timezone. So it is not in my script.

Hi Pinto, thanks a lot, I have added it to the script but i dont suppose you know
a way to set it so it knows it should be 1hour ahead do you? Mine is still 1hour
behind? http://www.northantsweather.com/wxastronomy.php

Sorry, no, not sure

Like I said here
The original author of the script is Breitling

I added that but I do not have any difference, too. Perhaps because for me it’s the same:

EDIT:sorry, I don’t need it, because my server is in my timezone. So it is not in my script.

Regards

Jose

For the date, GMT is GMT and it wouldn’t change regardless of time zone. I made mine show local time by changing

$fecha = gmdate("j m Y H:i", time())." GMT";

to

$fecha = date("n-j-y g:i a", time());

http://jcweather.us/sunpath.php

  • Jim

Thanks a lot. Got it now.

Regards

Jose

Thanks a lot Jim, thats got the correct time now, Just hope the sun’s movement is right
Will try to work it out tomoz… :slight_smile:

hmmmmm…Ive replaced the time part in the code as Jim Stated and my time is still off by 7 hours. Half of the arch line is missing, and so is the sun icon like others have. Any Ideas? Thanks, Mark.

http://www.snoqualmieweather.com/suntime.php

Mark,

For the arc, try removing the “-” from your longitude. For the time, you’ll need to go back a few posts and grab Pinto’s code to add at the beginning of your script and set your time zone. Also, where you put the -7, that really an “O” (the letter).

  • Jim

Thanks Jim. My Longitude starts with a “-” but the script doesnt like that, Took that out and everything works fine now. Thanks again.

Mark,

It’s actually astronomic formulas/calculations that require that versus the geographic side of things.

  • Jim

Well now its morning i have the same issue, removing GMT removes the sun lol
But having see about “-” in the Longitude i to have removed it and it appears to be ok now…

Thanks guys :slight_smile:

script updated
Thank you all :smiley:

No, thank YOU Pinto for your magic work :smiley:

update hi and low curve
If you use this, update the whole script, had to change some functions

Great, it looks like this (have to change to Dutch):

Mine looks similar:

Hi Peter
in the //hi position part, try to increase the number to 18 or even more, so your green line comes to the end at the right side

for ($i=0;$i<=18;$i++){