File: dst_utc_check.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-- 331 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
/*
 *  Checks to see if the server is using UTC/GMT timezone. Returns TRUE if it is NOT (makes function logic easier)
 */
CREATE FUNCTION dst_utc_check() RETURNS boolean
    LANGUAGE sql IMMUTABLE
    AS $$
    SELECT to_char( date_trunc('day', now()) , 'TZ' ) <> 'UTC' AND to_char( date_trunc('day', now()) , 'TZ' ) <> 'GMT';
$$;