Loading...
 
Features / Usability

Features / Usability


How can do change default locale? (UTC time)

posts: 3

biggrin Hello Tiki Users.

I want to change that all users displayed time zone to LOCAL from UTC

How can do it ?

Thank you for reading this.

posts: 2881 United Kingdom

Hi

This used to be available under Admin->General but since the recent release its no where to be point! I'm unsure of the answer to this one exclaim

Damian

posts: 18 United Kingdom

Hello All,

Was there any resolution to this? - I would like to change the TZ on my site but am a bit unsure how to do it - or where to set the correct variable!


posts: 18 United Kingdom

Hello All,

Was there any resolution to this? - I would like to change the TZ on my site but am a bit unsure how to do it - or where to set the correct variable!


posts: 1001 Canada

The HTML code in tiki-admin-include-general.tpl was commented before 1.7.0 release on revision 1.7.2.8. I emailed Jeremy about this changed and mentioned this information request. Let's hope he's not dead since he didn't log on tw.o since august.
If no answer maybe someone can figure out what was done checking the changes :
http://cvsmonitor.tikiwiki.org/cvsmonitor.pl?cmd=viewBrowseAuthor&author=jjongsma&module=Tikiwiki.Tikiwiki

posts: 2881 United Kingdom

> Chealer9:
> The HTML code in tiki-admin-include-general.tpl was commented before 1.7.0 release on revision 1.7.2.8. I emailed Jeremy about this changed and mentioned this information request. Let's hope he's not dead since he didn't log on tw.o since august.
> If no answer maybe someone can figure out what was done checking the changes :
> http://cvsmonitor.tikiwiki.org/cvsmonitor.pl?cmd=viewBrowseAuthor&author=jjongsma&module=Tikiwiki.Tikiwiki

Just do what I do, and modify the smarty file directly to show GMT and remove the from around the time smile

Damian

posts: 18 United Kingdom

I have no experience of Hacki ^H^H^H^H^H altering Smarty wink - Give me a clue t get started. I looked throught some of the files but dont see where tz is set

Cheers


posts: 2881 United Kingdom

> Chealer9:
> The HTML code in tiki-admin-include-general.tpl was commented before 1.7.0 release on revision 1.7.2.8. I emailed Jeremy about this changed and mentioned this information request. Let's hope he's not dead since he didn't log on tw.o since august.
> If no answer maybe someone can figure out what was done checking the changes :
> http://cvsmonitor.tikiwiki.org/cvsmonitor.pl?cmd=viewBrowseAuthor&author=jjongsma&module=Tikiwiki.Tikiwiki

Just do what I do, and modify the smarty file directly to show GMT and remove the from around the time smile

Damian

posts: 18 United Kingdom

I have no experience of Hacki ^H^H^H^H^H altering Smarty wink - Give me a clue t get started. I looked throught some of the files but dont see where tz is set

Cheers


posts: 1001 Canada
Jeremy just replied saying he might check this when back from vacation although he obviously stopped using TIki.
posts: 2881 United Kingdom

> Chealer9:
> Jeremy just replied saying he might check this when back from vacation although he obviously stopped using TIki.

Hehe, I think I remember some comments about it taking its time from the server, do we know the commit message saying why it was removed?

The function to modify is:

lib/smarty_tiki/modifier.tiki_long_datetime.php
lib/smarty_tiki/modifier.tiki_short_datetime.php

I usually change this line:
Copy to clipboard
return smarty_modifier_tiki_date_format($string, $tikilib->get_long_datetime_format(), null, tra("%A %d of %B, %Y[%H:%M:%S %Z]"));

to read:
Copy to clipboard
return smarty_modifier_tiki_date_format($string, $tikilib->get_long_datetime_format(), null, tra("%A %d of %B, %Y %H:%M:%S"));


removing the and dropping the %Z (timezone) or changing it to:

Copy to clipboard
return smarty_modifier_tiki_date_format($string, $tikilib->get_long_datetime_format(), null, tra("%A %d of %B, %Y[%H:%M:%S GMT]"));

for hardcoded GMT as most of my site dont allow users to change to the timezone smile

Damian

posts: 18 United Kingdom

>

> to read:
Copy to clipboard
> return smarty_modifier_tiki_date_format($string, $tikilib->get_long_datetime_format(), null, tra("%A %d of %B, %Y %H:%M:%S")); >

>

Oi thats cheating razz

All your doing is removing the time stamp - which I had done via Admin | General (I think)

I am in the UK and BST means the time is out by an hour how do I set the default TZ to GMT.

Strangely If a user logs in it corrects itself to but the %Z does not resolve to anything confused

I Think I should do something with Setlocale in my PHP.ini - Is that a good idea?

posts: 2881 United Kingdom

> hengis:
> >

> > to read:
Copy to clipboard
> > return smarty_modifier_tiki_date_format($string, $tikilib->get_long_datetime_format(), null, tra("%A %d of %B, %Y %H:%M:%S")); > >

> >
>
> Oi thats cheating razz

Works for me smile

> All your doing is removing the time stamp - which I had done via Admin | General (I think)
>
> I am in the UK and BST means the time is out by an hour how do I set the default TZ to GMT.

Me too! Get yourself down on the TikiFestUK

> Strangely If a user logs in it corrects itself to but the %Z does not resolve to anything confused
>
> I Think I should do something with Setlocale in my PHP.ini - Is that a good idea?

Possibily, Id need to read up a little too wink


Damian


posts: 2881 United Kingdom

> Chealer9:
> Jeremy just replied saying he might check this when back from vacation although he obviously stopped using TIki.

Hehe, I think I remember some comments about it taking its time from the server, do we know the commit message saying why it was removed?

The function to modify is:

lib/smarty_tiki/modifier.tiki_long_datetime.php
lib/smarty_tiki/modifier.tiki_short_datetime.php

I usually change this line:
Copy to clipboard
return smarty_modifier_tiki_date_format($string, $tikilib->get_long_datetime_format(), null, tra("%A %d of %B, %Y[%H:%M:%S %Z]"));

to read:
Copy to clipboard
return smarty_modifier_tiki_date_format($string, $tikilib->get_long_datetime_format(), null, tra("%A %d of %B, %Y %H:%M:%S"));


removing the and dropping the %Z (timezone) or changing it to:

Copy to clipboard
return smarty_modifier_tiki_date_format($string, $tikilib->get_long_datetime_format(), null, tra("%A %d of %B, %Y[%H:%M:%S GMT]"));

for hardcoded GMT as most of my site dont allow users to change to the timezone smile

Damian

posts: 18 United Kingdom

>

> to read:
Copy to clipboard
> return smarty_modifier_tiki_date_format($string, $tikilib->get_long_datetime_format(), null, tra("%A %d of %B, %Y %H:%M:%S")); >

>

Oi thats cheating razz

All your doing is removing the time stamp - which I had done via Admin | General (I think)

I am in the UK and BST means the time is out by an hour how do I set the default TZ to GMT.

Strangely If a user logs in it corrects itself to but the %Z does not resolve to anything confused

I Think I should do something with Setlocale in my PHP.ini - Is that a good idea?

posts: 2881 United Kingdom

> hengis:
> >

> > to read:
Copy to clipboard
> > return smarty_modifier_tiki_date_format($string, $tikilib->get_long_datetime_format(), null, tra("%A %d of %B, %Y %H:%M:%S")); > >

> >
>
> Oi thats cheating razz

Works for me smile

> All your doing is removing the time stamp - which I had done via Admin | General (I think)
>
> I am in the UK and BST means the time is out by an hour how do I set the default TZ to GMT.

Me too! Get yourself down on the TikiFestUK

> Strangely If a user logs in it corrects itself to but the %Z does not resolve to anything confused
>
> I Think I should do something with Setlocale in my PHP.ini - Is that a good idea?

Possibily, Id need to read up a little too wink


Damian


posts: 6

Here's my solution:
open file: modifier.tiki_date_format.php

change:
Line 22
from: else $format = preg_replace(???/%Z/???, “UTC???,$format);
to: else $format = strftime(" No value assignedd.%Y %H:%M %Z");

This gives the current time wherever the server is. I actually removed the time stamp (%H:%M %Z) and just have the date stamp so there's no confusion.

If you log in, you get the time stamp from your preferences.

Hope it didn't screw something else up...


posts: 8633 Israel

Hello jcrockett,

I'm on my way to do the modif you've post.

But after reflexion, i don't want to show the "server" time, but the time i choose ! :-)

Can you be kind to show me (add) a line that could implement a (servertime)+/-n options (meaning i want tiki to show the server time +/- n hours) for anybody... ?

Pleazzee ? :-)


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting