MySQL Forums
Forum List  »  General

Re: Convert DateTime to GMT Time
Posted by: douglas wilson
Date: August 18, 2014 01:10AM

CONVERT_TZ() to convert NOW() to GMT based on the server time zone and the GMT time zone.

Eg:mysql> SELECT CONVERT_TZ(NOW(),'-8:00','-0:00');

And you can try this command also in SQL

select DATEADD(hour,DATEDIFF (hour, GETDATE(), GETUTCDATE()),MyLocalDateTime) as

GmtDateTime

Options: ReplyQuote


Subject
Written By
Posted
Re: Convert DateTime to GMT Time
August 18, 2014 01:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.