I need to convert a string that represents a timestamp without time zone (i.e. "2017-03-08T20:53:05") in some time zone (e.g.'Etc/UTC') to a timestamp with timezone.
The issue is that the default time zone is not 'Etc/UTC'. So, when I'm trying to to
SELECT to_timestamp(field1, 'YYYY-MM-DD hh24:mi:ss')::timestamp without time zone at time zone 'Etc/UTC'
it converts the string to a value with the default timezone and then applies conversion from a local time zone to the 'Etc/UTC'. This is not what's requred.
Basically, I'm looking for a way to tell postgres that the original string value is representing time in a particular timezone, not the default local one.
Thank you.
Update: I've checked that the above statement is actually working.
SELECT to_timestamp(field1, 'YYYY-MM-DD hh24:mi:ss')::timestamp without time zone at time zone 'Etc/UTC'
I've been mislead by by the client's timezone setting.