varchar::timezone conversion - Mailing list pgsql-sql

From Marc Mamin
Subject varchar::timezone conversion
Date
Msg-id CA896D7906BF224F8A6D74A1B7E54AB3039E8B85@JENMAIL01.ad.intershop.net
Whole thread Raw
List pgsql-sql
Hi,

I'm facing an issue, where I build time stamps from a set of strings.


In this non working  example, I'm looking for a way to cast my strings
to the expected format 'timestamp' and timezone...


CREATE OR REPLACE FUNCTION "public"."timestamp_to_utcms"
(varchar,varchar) RETURNS int8 AS
$body$ SELECT EXTRACT(EPOCH FROM $1 AT TIME ZONE $2)::int8*1000;
$body$
LANGUAGE 'sql' IMMUTABLE RETURNS NULL ON NULL INPUT SECURITY INVOKER;


Thanks for your help,



Marc Mamin;


pgsql-sql by date:

Previous
From: Joe
Date:
Subject: Re: ORDER BY collation order
Next
From: Louis-David Mitterrand
Date:
Subject: exclusion query