2

I have a table with GMT timezone. Now i require to get results from different timezone.

if i search date 04-02-2013 all result will be in GMT and after converting to particular timezone it may have 05-02-2013.

so. I require a exact result of date 04-02-2013 for a particular timezone. for example +5:30 offset.(ie between GMT +5:30 and -5:30)

How to write for in mysql.

Niklas Wulff
  • 3,497
  • 2
  • 22
  • 43
Jomy Joseph
  • 107
  • 1
  • 10

2 Answers2

0

Try:

SELECT CONVERT_TZ(datefield,'US/Eastern','US/Central');

Found on: MySQL CONVERT_TZ()

Community
  • 1
  • 1
Guerra
  • 2,792
  • 1
  • 22
  • 32
  • 1
    but how to write a query for this, like--> "select * from records where date = CONVERT_TZ(datefield,'US/Eastern','US/Central')"; – Jomy Joseph Feb 04 '13 at 11:23
0

check this page of mysql offiicial website

http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_convert-tz
Suhel Meman
  • 3,702
  • 1
  • 18
  • 26