Is there any MYSQL function available to convert UTC Time String with TimeZone to DATETIME?
Ex: 2013-05-16T13:15:30Z
Cheers;
you can use convert_tz directly on that timestamp:
select T,
cast(T as datetime), -- to cast
convert_tz(T, '+00:00', '+08:00') -- to convert to local time
from
(select '2013-05-16T13:15:30Z' T) D
Depending upon your MySQL configuration you may be able to use @@session.time_zone
to make the above +08:00
less static
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With