change time according to GMT or timezones
i facing problem to post posted time in different countries.. correctly. i have need to change date time according to time zones. I found this code ..SQL CONVERT_TZ function help me..
CONVERT_TZ function change time according to time zone.
in this example i change date having format (YYYY-MM-DD HH:ii:ss)
which is according to usa timezone (6:00) to indian time zone (05:30)
SELECT `chatId`,`userId`,`sellerId`,`sellerUserId`,`message`,`status`,`cstatus`,CONVERT_TZ(`date`,'-6:00','+05:30') as date FROM `fast_my_chat`
this code helping you also..
No comments:
Post a Comment