This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

SET TIME ZONE

Changes the TIME ZONE run-time parameter for the current.

Changes the TIME ZONE run-time parameter for the current session. Use SHOW TIMEZONE to show the session's current time zone.

If you set the timezone using POSIX format, the timezone abbreviation you use overrides the default timezone abbreviation. If the date style is set to POSTGRES, the timezone abbreviation you use is also used when converting a timestamp to a string.

Syntax

SET TIME ZONE [TO] { value | 'value' }

Parameters

value
One of the following:
  • A time zone literal supported by Vertica. To view the default list of valid literals, see the files in the following directory:

    /opt/vertica/share/timezonesets
    
  • A signed integer representing an offset from UTC in hours

  • A time zone literal with a signed integer offset. For example:

    => SET TIME ZONE TO 'America/New York -3'; -- equivalent to Pacific time
    
  • An interval value

  • Constants LOCAL and DEFAULT, which respectively set the time zone to the one specified in environment variable TZ, or if TZ is undefined, to the operating system time zone.

Only valid (timezone+offset) combination are acceptable as parameter for this function.

Privileges

None

Examples

=> SET TIME ZONE TO DEFAULT;
=> SET TIME ZONE TO 'PST8PDT'; -- Berkeley, California
=> SET TIME ZONE TO 'Europe/Rome'; -- Italy
=> SET TIME ZONE TO '-7'; -- UDT offset equivalent to PDT
=> SET TIME ZONE TO INTERVAL '-08:00 HOURS';

See also

Using time zones with Vertica

1 - Time zone names for setting TIME ZONE

The time zone names listed below are recognized by Vertica as valid settings for the SQL time zone (the TIME ZONE run-time parameter).

The time zone names listed below are valid settings for the SQL time zone (the TIME ZONE run-time parameter).

These names are not the same as the names shown in /opt/vertica/share/timezonesets, which are recognized by Vertica in date/time input values. The TIME ZONE names listed below imply a local Daylight Saving Time rule, where date/time input names represent a fixed offset from UTC.

In many cases, the same zone has several names. These are grouped together. The list is sorted primarily by commonly used zone names.

In addition to the names in the list, Vertica accepts time zone names as one of the following:

  • STDoffset

  • STDoffsetDST

where STD is a zone abbreviation, offset is a numeric offset in hours west from UTC, and DST is an optional Daylight Saving Time zone abbreviation, assumed to stand for one hour ahead of the given offset.

For example, if EST5EDT were not already a recognized zone name, Vertica accepts it as functionally equivalent to USA East Coast time. When a Daylight Saving Time zone name is present, Vertica assumes it uses USA time zone rules, so this feature is of limited use outside North America.

Time zones

  • Africa:
    • Africa/Abidjan
    • Africa/Accra
    • Africa/Addis_Ababa
    • Africa/Algiers
    • Africa/Asmera
    • Africa/Bamako
    • Africa/Bangui
    • Africa/Banjul
    • Africa/Bissau
    • Africa/Blantyre
    • Africa/Brazzaville
    • Africa/Bujumbura
    • Africa/Cairo Egypt
    • Africa/Casablanca
    • Africa/Ceuta
    • Africa/Conakry
    • Africa/Dakar
    • Africa/Dar_es_Salaam
    • Africa/Djibouti
    • Africa/Douala
    • Africa/El_Aaiun
    • Africa/Freetown
    • Africa/Gaborone
    • Africa/Harare
    • Africa/Johannesburg
    • Africa/Kampala
    • Africa/Khartoum
    • Africa/Kigali
    • Africa/Kinshasa
    • Africa/Lagos
    • Africa/Libreville
    • Africa/Lome
    • Africa/Luanda
    • Africa/Lubumbashi
    • Africa/Lusaka
    • Africa/Malabo
    • Africa/Maputo
    • Africa/Maseru
    • Africa/Mbabane
    • Africa/Mogadishu
    • Africa/Monrovia
    • Africa/Nairobi
    • Africa/Ndjamena
    • Africa/Niamey
    • Africa/Nouakchott
    • Africa/Ouagadougou
    • Africa/Porto-Novo
    • Africa/Sao_Tome
    • Africa/Timbuktu
    • Africa/Tripoli Libya
    • Africa/Tunis
    • Africa/Windhoek
  • America
    • America/Adak America/Atka US/Aleutian
    • America/Anchorage SystemV/YST9YDT US/Alaska
    • America/Anguilla
    • America/Antigua
    • America/Araguaina
    • America/Aruba
    • America/Asuncion
    • America/Bahia
    • America/Barbados
    • America/Belem
    • America/Belize
    • America/Boa_Vista
    • America/Bogota
    • America/Boise
    • America/Buenos_Aires
    • America/Cambridge_Bay
    • America/Campo_Grande
    • America/Cancun
    • America/Caracas
    • America/Catamarca
    • America/Cayenne
    • America/Cayman
    • America/Chicago CST6CDT SystemV/CST6CDT US/Central
    • America/Chihuahua
    • America/Cordoba America/Rosario
    • America/Costa_Rica
    • America/Cuiaba
    • America/Curacao
    • America/Danmarkshavn
    • America/Dawson
    • America/Dawson_Creek
    • America/Denver MST7MDT SystemV/MST7MDT US/Mountain America/Shiprock Navajo
    • America/Detroit US/Michigan
    • America/Dominica
    • America/Edmonton Canada/Mountain
    • America/Eirunepe
    • America/El_Salvador
    • America/Ensenada America/Tijuana Mexico/BajaNorte
    • America/Fortaleza
    • America/Glace_Bay
    • America/Godthab
    • America/Goose_Bay
    • America/Grand_Turk
    • America/Grenada
    • America/Guadeloupe
    • America/Guatemala
    • America/Guayaquil
    • America/Guyana
    • America/Halifax Canada/Atlantic SystemV/AST4ADT
    • America/Havana Cuba
    • America/Hermosillo
    • America/Indiana/Indianapolis
    • America/Indianapolis
    • America/Fort_Wayne EST SystemV/EST5 US/East-Indiana
    • America/Indiana/Knox America/Knox_IN US/Indiana-Starke
    • America/Indiana/Marengo
    • America/Indiana/Vevay
    • America/Inuvik
    • America/Iqaluit
    • America/Jamaica Jamaica
    • America/Jujuy
    • America/Juneau
    • America/Kentucky/Louisville America/Louisville
    • America/Kentucky/Monticello
    • America/La_Paz
    • America/Lima
    • America/Los_Angeles PST8PDT SystemV/PST8PDT US/Pacific US/Pacific- New
    • America/Maceio
    • America/Managua
    • America/Manaus Brazil/West
    • America/Martinique
    • America/Mazatlan Mexico/BajaSur
    • America/Mendoza
    • America/Menominee
    • America/Merida
    • America/Mexico_City Mexico/General
    • America/Miquelon
    • America/Monterrey
    • America/Montevideo
    • America/Montreal
    • America/Montserrat
    • America/Nassau
    • America/New_York EST5EDT SystemV/EST5EDT US/Eastern
    • America/Nipigon
    • America/Nome
    • America/Noronha Brazil/DeNoronha
    • America/North_Dakota/Center
    • America/Panama
    • America/Pangnirtung
    • America/Paramaribo
    • America/Phoenix MST SystemV/MST7 US/Arizona
    • America/Port-au-Prince
    • America/Port_of_Spain
    • America/Porto_Acre America/Rio_Branco Brazil/Acre
    • America/Porto_Velho
    • America/Puerto_Rico SystemV/AST4
    • America/Rainy_River
    • America/Rankin_Inlet
    • America/Recife
    • America/Regina Canada/East-Saskatchewan Canada/Saskatchewan SystemV/CST6
    • America/Santiago Chile/Continental
    • America/Santo_Domingo
    • America/Sao_Paulo Brazil/East
    • America/Scoresbysund
    • America/St_Johns Canada/Newfoundland
    • America/St_Kitts
    • America/St_Lucia
    • America/St_Thomas America/Virgin
    • America/St_Vincent
    • America/Swift_Current
    • America/Tegucigalpa
    • America/Thule
    • America/Thunder_Bay
    • America/Toronto Canada/Eastern
    • America/Tortola
    • America/Vancouver Canada/Pacific
    • America/Whitehorse Canada/Yukon
    • America/Winnipeg Canada/Central
    • America/Yakutat
    • America/Yellowknife
  • Antarctica
    • Antarctica/Casey
    • Antarctica/Davis
    • Antarctica/DumontDUrville
    • Antarctica/Mawson
    • Antarctica/McMurdo
    • Antarctica/South_Pole
    • Antarctica/Palmer
    • Antarctica/Rothera
    • Antarctica/Syowa
    • Antarctica/Vostok
  • Asia
    • Asia/Aden
    • Asia/Almaty
    • Asia/Amman
    • Asia/Anadyr
    • Asia/Aqtau
    • Asia/Aqtobe
    • Asia/Ashgabat Asia/Ashkhabad
    • Asia/Baghdad
    • Asia/Bahrain
    • Asia/Baku
    • Asia/Bangkok
    • Asia/Beirut
    • Asia/Bishkek
    • Asia/Brunei
    • Asia/Calcutta
    • Asia/Choibalsan
    • Asia/Chongqing Asia/Chungking
    • Asia/Colombo
    • Asia/Dacca Asia/Dhaka
    • Asia/Damascus
    • Asia/Dili
    • Asia/Dubai
    • Asia/Dushanbe
    • Asia/Gaza
    • Asia/Harbin
    • Asia/Hong_Kong Hongkong
    • Asia/Hovd
    • Asia/Irkutsk
    • Asia/Jakarta
    • Asia/Jayapura
    • Asia/Jerusalem Asia/Tel_Aviv Israel
    • Asia/Kabul
    • Asia/Kamchatka
    • Asia/Karachi
    • Asia/Kashgar
    • Asia/Katmandu
    • Asia/Krasnoyarsk
    • Asia/Kuala_Lumpur
    • Asia/Kuching
    • Asia/Kuwait
    • Asia/Macao Asia/Macau
    • Asia/Magadan
    • Asia/Makassar Asia/Ujung_Pandang
    • Asia/Manila
    • Asia/Muscat
    • Asia/Nicosia Europe/Nicosia
    • Asia/Novosibirsk
    • Asia/Omsk
    • Asia/Oral
    • Asia/Phnom_Penh
    • Asia/Pontianak
    • Asia/Pyongyang
    • Asia/Qatar
    • Asia/Qyzylorda
    • Asia/Rangoon
    • Asia/Riyadh
    • Asia/Riyadh87 Mideast/Riyadh87
    • Asia/Riyadh88 Mideast/Riyadh88
    • Asia/Riyadh89 Mideast/Riyadh89
    • Asia/Saigon
    • Asia/Sakhalin
    • Asia/Samarkand
    • Asia/Seoul ROK
    • Asia/Shanghai PRC
    • Asia/Singapore Singapore
    • Asia/Taipei ROC
    • Asia/Tashkent
    • Asia/Tbilisi
    • Asia/Tehran Iran
    • Asia/Thimbu Asia/Thimphu
    • Asia/Tokyo Japan
    • Asia/Ulaanbaatar Asia/Ulan_Bator
    • Asia/Urumqi
    • Asia/Vientiane
    • Asia/Vladivostok
    • Asia/Yakutsk
    • Asia/Yekaterinburg
    • Asia/Yerevan
  • Atlantic
    • Atlantic/Azores
    • Atlantic/Bermuda
    • Atlantic/Canary
    • Atlantic/Cape_Verde
    • Atlantic/Faeroe
    • Atlantic/Madeira
    • Atlantic/Reykjavik Iceland
    • Atlantic/South_Georgia
    • Atlantic/St_Helena
    • Atlantic/Stanley
  • Australia
    • Australia/ACT
    • Australia/Canberra
    • Australia/NSW
    • Australia/Sydney
    • Australia/Adelaide
    • Australia/South
    • Australia/Brisbane
    • Australia/Queensland
    • Australia/Broken_Hill
    • Australia/Yancowinna
    • Australia/Darwin
    • Australia/North
    • Australia/Hobart
    • Australia/Tasmania
    • Australia/LHI
    • Australia/Lord_Howe
    • Australia/Lindeman
    • Australia/Melbourne
    • Australia/Victoria
    • Australia/Perth Australia/West
  • CET
  • EET
  • Etc/GMT
    • GMT
    • GMT+0
    • GMT-0
    • GMT0
    • Greenwich
    • Etc/Greenwich
    • Etc/GMT+0...Etc/GMT+12
    • Etc/GMT-0...Etc/GMT-14
  • Europe
    • Europe/Amsterdam
    • Europe/Andorra
    • Europe/Athens
    • Europe/Belfast
    • Europe/Belgrade
    • Europe/Ljubljana
    • Europe/Sarajevo
    • Europe/Skopje
    • Europe/Zagreb
    • Europe/Berlin
    • Europe/Brussels
    • Europe/Bucharest
    • Europe/Budapest
    • Europe/Chisinau Europe/Tiraspol
    • Europe/Copenhagen
    • Europe/Dublin Eire
    • Europe/Gibraltar
    • Europe/Helsinki
    • Europe/Istanbul Asia/Istanbul Turkey
    • Europe/Kaliningrad
    • Europe/Kiev
    • Europe/Lisbon Portugal
    • Europe/London GB GB-Eire
    • Europe/Luxembourg
    • Europe/Madrid
    • Europe/Malta
    • Europe/Minsk
    • Europe/Monaco
    • Europe/Moscow W-SU
    • Europe/Oslo
    • Arctic/Longyearbyen
    • Atlantic/Jan_Mayen
    • Europe/Paris
    • Europe/Prague Europe/Bratislava
    • Europe/Riga
    • Europe/Rome Europe/San_Marino Europe/Vatican
    • Europe/Samara
    • Europe/Simferopol
    • Europe/Sofia
    • Europe/Stockholm
    • Europe/Tallinn
    • Europe/Tirane
    • Europe/Uzhgorod
    • Europe/Vaduz
    • Europe/Vienna
    • Europe/Vilnius
    • Europe/Warsaw Poland
    • Europe/Zaporozhye
    • Europe/Zurich
  • Factory
  • Indian
    • Indian/Antananarivo
    • Indian/Chagos
    • Indian/Christmas
    • Indian/Cocos
    • Indian/Comoro
    • Indian/Kerguelen
    • Indian/Mahe
    • Indian/Maldives
    • Indian/Mauritius
    • Indian/Mayotte
    • Indian/Reunion
  • MET
  • Pacific
    • Pacific/Apia
    • Pacific/Auckland NZ
    • Pacific/Chatham NZ-CHAT
    • Pacific/Easter
    • Chile/EasterIsland
    • Pacific/Efate
    • Pacific/Enderbury
    • Pacific/Fakaofo
    • Pacific/Fiji
    • Pacific/Funafuti
    • Pacific/Galapagos
    • Pacific/Gambier SystemV/YST9
    • Pacific/Guadalcanal
    • Pacific/Guam
    • Pacific/Honolulu HST SystemV/HST10 US/Hawaii
    • Pacific/Johnston
    • Pacific/Kiritimati
    • Pacific/Kosrae
    • Pacific/Kwajalein Kwajalein
    • Pacific/Majuro
    • Pacific/Marquesas
    • Pacific/Midway
    • Pacific/Nauru
    • Pacific/Niue
    • Pacific/Norfolk
    • Pacific/Noumea
    • Pacific/Pago_Pago
    • Pacific/Samoa US/Samoa
    • Pacific/Palau
    • Pacific/Pitcairn SystemV/PST8
    • Pacific/Ponape
    • Pacific/Port_Moresby
    • Pacific/Rarotonga
    • Pacific/Saipan
    • Pacific/Tahiti
    • Pacific/Tarawa
    • Pacific/Tongatapu
    • Pacific/Truk
    • Pacific/Wake
    • Pacific/Wallis
    • Pacific/Yap
  • UCT Etc
  • UCT
  • UTC
    • Universal Zulu
    • Etc/UTC
    • Etc/Universal
    • Etc/Zulu
  • WET