WebFaction
Community site: login faq

My database is configured with UTC timezone, how I can change that?

asked 04 Feb '16, 06:41

maturano
1315
accept rate: 0%


If you need the time zone set for a session, then you can use:

SET time_zone = '+05:30'

If you need the time zone set globally, then you will need to use a private MySQL instance, with the following setting in your my.cnf:

default_time_zone='+05:30'
permanent link

answered 04 Feb '16, 18:47

seanf
12.2k42136
accept rate: 37%

"you will need to use a private MySQL instance"

That's what I needed to know. Thanks :)

(04 Feb '16, 19:11) maturano
SET time_zone = '+05:30'

$mysqli->query("SET time_zone = '+05:30'");
permanent link

answered 04 Feb '16, 13:10

anjanesh
78929
accept rate: 16%

That works just for a session. I mean change the configuration.

(04 Feb '16, 18:41) maturano
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×168
×16
×8
×1

question asked: 04 Feb '16, 06:41

question was seen: 3,312 times

last updated: 04 Feb '16, 19:11

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM