Change timezone of database

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
wiktoryoko
New to forums
New to forums
Posts: 2
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Tue Mar 24, 2015 3:50 pm

Change timezone of database

Post by wiktoryoko »

Hi, i need to change time on my mysql db but i dont know how.
i have not access to Set timezone.
When i execute select now(); i can see 00:50:20 when its 09:50:20 in my country.
Can someone help me?
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

Re: Change timezone of database

Post by Vanderburg »

You don't really need to store it in a different timezone, you just need to display it in a different one, so you should simply shift all the date/time converting responsibility over to your scripting language.
User avatar
Edge100x
Founder
Founder
Posts: 12948
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Change timezone of database

Post by Edge100x »

Have you tried something like this at the beginning of your session?

Code: Select all

SET SESSION time_zone = '+01:00'
User avatar
rlm850
This is my homepage
This is my homepage
Posts: 141
Joined: Thu Dec 10, 2009 12:17 am
Location: Staten Island, NY
Contact:

Re: Change timezone of database

Post by rlm850 »

Vanderburg wrote:You don't really need to store it in a different timezone, you just need to display it in a different one, so you should simply shift all the date/time converting responsibility over to your scripting language.
This is totally off topic and I hope you guys don't mind.. but I absolutely love your avatar. You forgot the point though!
Post Reply