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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -