Fun at zangOOr Click Here
1 like 0 dislike
1.2k views
Our database server is in the USA which is 5 hours 30 minutes(GMT) behind our time(IST).

Does anyone know a way to change this so that the 5 hours 30 minutes hours get added to the datetime?

In short I want to convert GMT time to IST
in Education & Reference by (640 points) | 1.2k views

1 Answer

0 like 0 dislike

You can do this easily by 2 methods

1.) select date_add(datetime_field, interval 330 minute) from table_name

OR

2.) Select DATE_ADD(DATE_ADD(datetime_field ,INTERVAL 5 HOUR),INTERVAL 30 MINUTE) as datetime_field from table_name

However, as stated in some articles on the internet it's best if you correct the problem from the source and update the timezone in your DBMS like Set the correct timezone in your setting files (php.ini for instance)

 

 

by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked May 27, 2014 in Education & Reference by Yogi (360 points) | 168 views
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,245 questions
1,400 answers
565 comments
4,809 users