How to change forum time

Started by Mr.IT, September 28, 2008, 08:02:02 PM

Previous topic - Next topic

Mr.IT


ccbtimewiz


Mr.IT

I want to change GMT +6:30 . I found %B %d, %Y, %I:%M:%S %p . how to change custon time ?

MrPhil

Wrong place. That %B... business is to format the time as you like it. If you want the forum to show a different time than what the server is set to, you follow ccbtimewiz's instructions (Admin > Configuration > Features and Options > Overall time offset) and enter the offset you want (in hours). If your server is showing GMT, you would enter a value of 6.5. If your server is showing GMT-5, you would enter 11.5. Note that if your server time shows Daylight Saving Time (non-GMT), I don't think there's any easy way to get it to GMT+n without changing the offset several times a year (or modifying code). This time would be shown to guests and members, but members can add their own time offset (in their profile) to change it to their local time (a non-0 value).

Floflo

#4
Hello !
I'm having a problem with my server too, but it's a little different.
My server's clock is exactly set a the correct time, including daylight saving time (i want it to be taken into account). I know that :
1) By using the date command in an SSH client connected to the server.
2) By creating a simple PHP page displaying the output of the date() function.

However, if in the forum options I set the time offset to 0, the clock and the post times are one hour off... I checked that it wasn't because of my personal time offset setting (it is set to 0 too). The only solution I have is to set the forum time offset to 1. This way, everything is ok, but I'm still wondering why this happens. Plus I don't know whether there will be a problem when the date of the switch to winter time arrives.
Moreover, I noticed that another forum (whose admin isn't me) that is on the same server is 2 hours off... (it uses PHPBB)

Sorry it's not really a problem since I have a solution but I'd like to understand.

My forum is here : hxxp:japanim.campus.ec-nantes.fr/forum/ [nonactive]
The other one is here : hxxp:forum.campus.ec-nantes.fr/ [nonactive]

Sorry for my English I'm French.

Ibiza MF

I have a same problem as user above. Server time is correct, forum offset is 0, but it shows 2 hours older time than it is. In mysql 'select now()' also returns correct time.

It might be related with OpenAds script which has reported wrong PHP timezone and I clicked it to correct it, but can't find way to undo that...

MrPhil

If the forum and profile offsets are both 0, but you don't see the server's time, there is another possibility. Once I saw mention of some sort of "internal timezone" setting, but I haven't been able to find it again, and don't recall if it was something in SMF, PHP, or elsewhere. So evidently there is another setting besides the two offsets that can affect your time. It would be nice if this was documented!

Floflo

Found it !
It's the default_timezone setting that can be found in the "settings" table in the forum database. I changed it from "Etc/GMT-1" to "Europe/Paris" manually (using PhpMyAdmin) because I couldn't find this setting anywhere in the admin pages.
For more info about PHP timezones : hxxp:www.php.net/timezones [nonactive]

Ibiza MF

#8
That database intervention didn't help me, I still have a problem. (SMF 1.1.6)

Only post time is incorrect - If I look at the profile "Last Active" time is correct.

ke

Quote from: Floflo on October 01, 2008, 01:48:53 AM
Found it !
It's the default_timezone setting that can be found in the "settings" table in the forum database. I changed it from "Etc/GMT-1" to "Europe/Paris" manually (using PhpMyAdmin) because I couldn't find this setting anywhere in the admin pages.
For more info about PHP timezones : http://www.php.net/timezones

Thanks a lot for this discovery - so far, there's been chaos in my forum twice a year. Now I trust those dark times are over. :D

greyknight17


Advertisement: