Page 1 of 1

[Resolved] timezones

Posted: Tue Aug 21, 2007 4:17 pm
by stalsy
Hi all,

I've installed for the second time Serendipity. It's a very cool blogging system.

My problem is with timezones plugin. I don't have Date PEAR package and I can't installing it. So I have choised to put this string for show the Date:
London
GMT
H:i:s

Providence
EDT
H:i:s
according to PHP Date format. But I can just see the same date in my page:
London: 15:08:03
Providence: 15:08:03
I've tryed to modify serendipity_plugin_timezones.php from

Code: Select all

 function generate_content(&$title) {
        global $serendipity;

        $title = $this->get_config('title');

        if ($this->get_config('timeshift') == "" && @include_once 'Date.php') {
		    $date = new Date();
		    //create the first date
            $date->convertTZbyID($this->get_config('zone1_name'));
		    $date1=$date->format($this->get_config('zone1_format'));

		    $date->convertTZbyID($this->get_config('zone2_name'));
		    $date2=$date->format($this->get_config('zone2_format'));
        } else {	
            $date1=date($this->get_config('zone1_format'));
            $date2=date($this->get_config('zone2_format'),time()+$this->get_config('timeshift'));

        }

        echo $this->get_config('zone1_text');
        echo $date1;
        echo '<br />';

        echo $this->get_config('zone2_text');
        echo $date2;
        echo '</div>';
    }
to

Code: Select all

 function generate_content(&$title) {
        global $serendipity;

        $title = $this->get_config('title');

        if ($this->get_config('timeshift') == "" && @include_once 'Date.php') {
		    $date = new Date();
		    //create the first date
            $date->convertTZbyID($this->get_config('zone1_name'));
		    $date1=$date->format($this->get_config('zone1_format'));

		    $date->convertTZbyID($this->get_config('zone2_name'));
		    $date2=$date->format($this->get_config('zone2_format'));
        } else {	
           date_default_timezone_set($this->get_config('zone1_name'));
            $date1=date($this->get_config('zone1_format'));
            date_default_timezone_set($this->get_config('zone2_name'));
           $date2=date($this->get_config('zone2_format'));
        }

        echo $this->get_config('zone1_text');
        echo $date1;
        echo '<br />';

        echo $this->get_config('zone2_text');
        echo $date2;
        echo '</div>';
    }
but the Date is always the same... I've read others related posts but I have not resolved my problem yet

thanks all

Re: timezones

Posted: Tue Aug 21, 2007 4:26 pm
by garvinhicking
Hi!

Hm, I don'T have experience with timezones, but may it be that "EDT" is not a recognized timezone format? HAve you tried to use "CET" for instance, just to check if it works with a different zone?

Regards,
Garvin

Posted: Tue Aug 21, 2007 4:48 pm
by stalsy
Thank you for reply

Unfortunately I've tried many code, I'm just able to see my localtime yet...

Posted: Wed Aug 22, 2007 10:30 am
by stalsy
I've resolved my problem... was a mistake in filling the last form.. I was too tired -.-'

Thank you