Account created on 17 December 2015, about 9 years ago
#

Recent comments

🇨🇺Cuba rafageist

Create the function for PostgreSQL:

CREATE OR REPLACE FUNCTION unix_timestamp(input_text character varying)
RETURNS bigint AS $$
DECLARE
    result bigint;
BEGIN
    SELECT EXTRACT(epoch FROM TO_TIMESTAMP(input_text, 'YYYY-MM-DD HH24:MI:SS')) INTO result;

    RETURN result;
EXCEPTION
    WHEN others THEN
        RAISE EXCEPTION 'Error';
END;
$$ LANGUAGE plpgsql;
Production build 0.71.5 2024