the datetime value coming from source is in CET .( but doesnt contain time zone in the value).
I need to convert that into GMT .
How would i write it ?
the datetime value coming from source is in CET .( but doesnt contain time zone in the value).
I need to convert that into GMT .
How would i write it ?
Starting with sql server 2016, you can use AT TIME ZONE
declare @dt2_myDate as datetime2(0) = '20190216 08:10:12' ;
select CONVERT(datetime2(0) , @dt2_myDate , 126)
AT TIME ZONE 'Central European Standard Time'
AT TIME ZONE 'UTC' as newDateTime
output:
newDateTime
16/02/2019 07:10:12 +00:00
dbfiddlehere
Thanks from reply. The output should be in datetime format . It hasn’t an extra offset information