sql - Get timestamp from date & time in UTC -
i have table have date , time timezone.
date_time_table +------------+--------------+ | date_t | time_tz | +------------+--------------+ | 2016-05-13 | 23:00:00 -02 | | 2016-05-14 | 13:00:00 +06 | +------------+--------------+
after run sql query 'utc' time
select timetz @ time zone 'utc' date_time_tz
the result is:
+--------------+ | time_tz | +--------------+ | 01:00:00 +00 | | 07:00:00 +00 | +--------------+
can write sql combined date_t time_tz calculate date too?
the result expect is:
+------------+------------+ | date_time_tz | +------------+------------+ | 2016-05-14 01:00:00 +00 | | 2016-05-14 07:00:00 +00 | +------------+------------+
i try :
select concat(date_t , ' ' ,time_tz) @ time zone 'utc' date_time_table
but not work.
select concat(date_t , ' ' ,time_tz)::timestamp @ time zone 'utc' date_time_table
try casting this
Comments
Post a Comment