[Resolved] timezones

Creating and modifying plugins.
Post Reply
stalsy
Regular
Posts: 11
Joined: Tue Aug 21, 2007 3:48 pm

[Resolved] timezones

Post 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
Last edited by stalsy on Wed Aug 22, 2007 10:31 am, edited 1 time in total.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: timezones

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stalsy
Regular
Posts: 11
Joined: Tue Aug 21, 2007 3:48 pm

Post by stalsy »

Thank you for reply

Unfortunately I've tried many code, I'm just able to see my localtime yet...
stalsy
Regular
Posts: 11
Joined: Tue Aug 21, 2007 3:48 pm

Post by stalsy »

I've resolved my problem... was a mistake in filling the last form.. I was too tired -.-'

Thank you
Post Reply