Hide
Don't get spied on – We respect your privacy and provide numerous options to protect it. Join Siafoo Now or Learn More

PostgreSQL internet date function Atom Feed 0

In Brief An SQL function for converting a time zone aware timestamp into a string representing internet time (see RFC 3339) as used by Atom feeds (see RFC 4287) and sitemaps
# 's
1CREATE OR REPLACE FUNCTION internet_date(timestamp with time zone) RETURNS text AS $$
2 SELECT to_char($1, 'YYYY-MM-DDThh24:MI:SS') || to_char(EXTRACT(timezone_hour FROM $1), '00')
3 || ':' || trim(to_char(EXTRACT(timezone_minutes FROM $1), '00'));
4$$ LANGUAGE SQL;

An SQL function for converting a time zone aware timestamp into a string representing internet time (see RFC 3339) as used by Atom feeds (see RFC 4287) and sitemaps