PostgreSQL internet date function

Revision 1 vs. Revision 2

Changelog: Time format is now 24H and the minutes actually show up, instead of showing the date =)

Legend:

Unmodified
Added
Removed
  • Code

    r1 r2  
    1 CREATE OR REPLACE FUNCTION internet_date(timestamp with time zone) RETURNS text AS $$  
    2         SELECT to_char($1, 'YYYY-MM-DDThh:mm:ss')  || to_char(EXTRACT(timezone_hour FROM $1), '00')  
    3                                             || ':' || trim(to_char(EXTRACT(timezone_minutes FROM $1), '00'));  
     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')); 
    44$$ LANGUAGE SQL;