Weird Timezones Plugin

Creating and modifying plugins.
Post Reply
Garga
Posts: 2
Joined: Tue Mar 08, 2011 3:44 pm

Weird Timezones Plugin

Post by Garga »

Sorry, I might be to stupid, but I do not comprehend how to set a time zone for my current location Indonesia in the provided timezones plugin.

I have tried all kinds of timezone abbreviations as well as adding something like UTC+7 or +7... nothing is recognized.

Any suggestions or am I missing something here?

Thx in advance.

Michael
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Weird Timezones Plugin

Post by Timbalu »

Did you try setting your timezone in
Admin Panel / Administration / Configuration / Design and Options?

There you can choose to set it based to your Servers own timezone settings or GMT.
Underneath you can set the difference to above settings in hours. This works well.

As far as I know you don't need another foreign plugin.

Re-thinking & Edit:
The above answer is still true, but sorry, I didn't know we even have a plugin like this...
Current time in Indonesia is GMT+7

Just doing some Copy & Paste:
You can use tst-7 or change to wib-7.
So TST-7 is wrong for your location -- it will produce the same results as MST-7 (in the US, Mountain Standard Time). The 3 letters (or more) can be anything (see man environ) but what is important is the offset from GMT. For Jakarta, the offset is +7 so you could use TZ=JAKARTA+7 or JAK+7.
One additional note: JAKARTA-7 TST-7 or WIB-7 produce the same time as JAKARTA+7 TST+7 or WIB+7. However, the day is incorrect with -7. This is easily overlooked because of the international date line. Note also that if you set the time and date with the wrong TZ value, then your server will not have a correct GMT value (date -u for instance) and this can be critical for some applications. Here is a great reference:

http://www.timezoneconverter.com/
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Weird Timezones Plugin

Post by garvinhicking »

Hi!

It's much easier. ;-)

Serendipity runs on a server, and that server's timezone is used as everything for the date output. You only need to enter a number of hours that your LOCAL timezone (you, the author of the blog) differs from the server timezone, and enter that amount in the configuration.

To do that, simply publish a blog entry now. Your server will then say the entry was created, for example, on March 1st, 13:00 o'clock. But since I live in germany, and the server is in London, my local time currently is 14:00 o'clock. So I need to enter "1" in the timezone to adjust for that.

If in my time it were 4 o'clock in the morning, I would have to add "-9".

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/
Garga
Posts: 2
Joined: Tue Mar 08, 2011 3:44 pm

Re: Weird Timezones Plugin

Post by Garga »

Thank's for your suggestions, but somehow it doesn't solve my problem.
Actually, I just want to show to different timezones in my blog using the provided "timezones plugin".
My first time zone is named "at home", with the abbreviation "CET" which produces the correct time for e.g. Germany. The second time zone I'm trying to set on Western Indonesian Time, so GMT+7. But no matter what abbreviation I enter that would match that particular time zone, e.g WIB is recognized by the system. Also things like 7, +7, GMT+7 or anything else suggested works. But if I enter MST for example the correct time for certain parts of North America is displayed. Also "BDT" will result in the correct time for Brunei which is GMT+6. But no luck for Indonesia so far.

So it is not about setting the difference from the server time to the time zone I'm writing my blog entries in.

I hope someone can help me out.

Thx again, Michael
LazyBadger
Regular
Posts: 176
Joined: Mon Aug 25, 2008 12:25 pm
Location: Russia
Contact:

Re: Weird Timezones Plugin

Post by LazyBadger »

Garga wrote: Actually, I just want to show to different timezones in my blog using the provided "timezones plugin".
AFAIK, there ARE NOT any "timezones plugin" for correcting display-time in user's local time. You can only define 1 time offset and time will be corrected from server's time according to setting and this, same for everybody time will be shown on blog
Quis custodiet ipsos custodes?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Weird Timezones Plugin

Post by garvinhicking »

Hi!

Whoops. I'm terribly sorry I didn't properly get your posting.

Sadly I don't know much about that specific plugin. I know it uses the PEAR Date package, which in Turn relies on system timezones.

If in the plugin, after $date = newDate (line 178) you add this:

Code: Select all

$list = Date_TimeZone::getAvailableIDs();
print_r($list);
you should get an output in your blog listing all available timezones. From what I gather, you cannot add offsets there; you are required to use the specific Timezone name, like "US/Eastern" or whatever...

HTH,
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/
Post Reply