File: dst_change.sql

package info (click to toggle)
mimeo 1.5.1-20
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,300 kB
  • sloc: sql: 85,916; python: 81; makefile: 23; sh: 16
file content (8 lines) | stat: -rw-r--r-- 282 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
/*
 *  Checks if DST time change has occured
 */
CREATE FUNCTION dst_change(date timestamp with time zone) RETURNS boolean
    LANGUAGE sql IMMUTABLE
    AS $$ 
    SELECT to_char( date_trunc('day', $1) , 'TZ' ) <> to_char( date_trunc( 'day', $1 ) + '1 day'::interval, 'TZ' ); 
$$;