News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Change the time zone of all users ? (RC3)

Started by gevv, June 02, 2021, 11:51:53 AM

Previous topic - Next topic

gevv

Hello,

How do I change the time zone of all users ?

Is there a sql query?

Thanks.
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Shades.

Although you can set the board timezone in Admin>Features and Optinons...
I believe I read on here somewhere that they have to set their own timezone under Profile>Look and Layout.
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Sir Osis of Liver

You can run a query to set time_offset in _members table to same value for all members (0 is server time), but sounds like a bad idea.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

gevv

Forum Server Time zone set to ""utc+03:00 turkey standart time""

but the time zone of registered all users is ""utc-coordinated universal time"" (same for new members)
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Sir Osis of Liver

Current utc time is 17:00.  Current forum time in Profile is 01:00:04 PM.  Displayed time is +/- time_offset.  That's in 2.0.  Looks like 2.1 uses utc as default time in Profile, so you would have to set time_offset relative to utc.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shawnb61

Note that 2.0 & 2.1 behave differently.  2.0 used offsets to get to the system & user time.  2.1 uses timezones.  In 2.1, you should only need to provide a forum default timezone and users can specify their own when desired & different from the default.  In 2.1, you should never need to use an offset, unless for some reason, the server isn't really honoring the utc standard (which should be extremely rare).

I believe the bug referenced here is this, and has been reported before:
https://github.com/SimpleMachines/SMF2.1/issues/6747

I am pretty sure there is no automated mass change function.  If you really do need to change it globally for some reason, you will need to do so via SQL.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Sir Osis of Liver

So if you run a query to set all members to same timezone, then you'd also have to reset time_offset to 0 to get everyone on same time (if that's what OP wants).
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Shades.

Quote from: shawnb61 on June 02, 2021, 02:08:37 PM
Note that 2.0 & 2.1 behave differently.  2.0 used offsets to get to the system & user time.  2.1 uses timezones.  In 2.1, you should only need to provide a forum default timezone and users can specify their own when desired & different from the default.  In 2.1, you should never need to use an offset, unless for some reason, the server isn't really honoring the utc standard (which should be extremely rare).

I believe the bug referenced here is this, and has been reported before:
https://github.com/SimpleMachines/SMF2.1/issues/6747

I am pretty sure there is no automated mass change function.  If you really do need to change it globally for some reason, you will need to do so via SQL.

While we're on the subject, I see where the timezone is on the registration page but is it mandatory or is it possible to make it mandatory/required? I don't see any other option other than to turn it on or off (check it or uncheck it) in admin? (If you need to split this topic, I understand ;))

I think all the "Standard Profile Fields" should have an option in admin to be required or not on registration and not just the custom profiles. (And the timezones for sure) Just my opinion. 8)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Sir Osis of Liver

I don't see any timezone option on registration form, or any way to put it there.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Shades.

It is on mine (Admin>Features and Options>Profile Fields)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Sir Osis of Liver

Yeah, I see it now, it's disabled by default.  OP should probably enable that after resetting existing members' timezones.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

gevv

Is there a sql query to change the timezone of old members?
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Sir Osis of Liver

If you want to change all members to Turkey Standard Time -



UPDATE `smf_members` SET `timezone` = 'Europe/Istanbul';
UPDATE `smf_members` SET `time_offset` = '0';


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: