Skip to main content

converttolocaltime - script and chart function

Converts a UTC or GMT timestamp to local time as a dual value. The place can be any of a number of cities, places and time zones around the world. 

Syntax:  

ConvertToLocalTime(timestamp [, place [, ignore_dst=false]])

Return data type: dual

Arguments:  

Argument Description
timestamp The timestamp,or expression resolving to a timestamp, to convert.
place

A place or timezone from the table of valid places and timezones below. Alternatively, you can useGMT or UTC to define the local time. The following values and time offset ranges are valid:

  • GMT
  • GMT-12:00 - GMT-01:00
  • GMT+01:00 - GMT+14:00
  • UTC
  • UTC-12:00 - UTC-01:00
  • UTC+01:00 - UTC+14:00
Information noteYou can only use standard time offsets. It's not possible to use an arbitrary time offset, for example, GMT-04:27.
ignore_dst Set to True if you want to ignore DST (daylight saving time).

The resulting time is adjusted for daylight-saving time, unless ignore_dst is set to True.

Valid places and time zones
Abu Dhabi Central America Kabul Newfoundland Tashkent
Adelaide Central Time (US & Canada) Kamchatka Novosibirsk Tbilisi
Alaska Chennai Karachi Nuku'alofa Tehran
Amsterdam Chihuahua Kathmandu Osaka Tokyo
Arizona Chongqing Kolkata Pacific Time (US & Canada) Urumqi
Astana Copenhagen Krasnoyarsk Paris Warsaw
Athens Darwin Kuala Lumpur Perth Wellington
Atlantic Time (Canada) Dhaka Kuwait Port Moresby West Central Africa
Auckland Eastern Time (US & Canada) Kyiv Prague Vienna
Azores Edinburgh La Paz Pretoria Vilnius
Baghdad Ekaterinburg Lima Quito Vladivostok
Baku Fiji Lisbon Riga Volgograd
Bangkok Georgetown Ljubljana Riyadh Yakutsk
Beijing Greenland London Rome Yerevan
Belgrade Greenwich Mean Time : Dublin Madrid Samoa Zagreb
Berlin Guadalajara Magadan Santiago  
Bern Guam Mazatlan Sapporo  
Bogota Hanoi Melbourne Sarajevo  
Brasilia Harare Mexico City Saskatchewan  
Bratislava Hawaii Mid-Atlantic Seoul  
Brisbane Helsinki Minsk Singapore  
Brussels Hobart Monrovia Skopje  
Bucharest Hong Kong Monterrey Sofia  
Budapest Indiana (East) Moscow Solomon Is.  
Buenos Aires International Date Line West Mountain Time (US & Canada) Sri Jayawardenepura  
Cairo Irkutsk Mumbai St. Petersburg  
Canberra Islamabad Muscat Stockholm  
Cape Verde Is. Istanbul Nairobi Sydney  
Caracas Jakarta New Caledonia Taipei  
Casablanca Jerusalem New Delhi Tallinn  

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!