Skip to content

Modern Tz TimeZone FindById

Paul Squires edited this page Nov 11, 2026 · 1 revision

Home › Time Zones › Time Zones (std/tz) › TimeZone.FindById

TimeZone.FindById

Returns the time zone with an IANA id such as Europe/Paris, or stops with an error.

Syntax

TimeZone.FindById( byref zoneId as const ustring ) as TimeZone

Notes

  • The id is matched without regard to case and comes back spelled as the database spells it.
  • An id that is not found is runtime error 1. Use TryFindById for ids from outside the program.
  • Where zones come from: $TZDIR, then the system's zone files on Linux and macOS, then the database std/tzdata puts in the program.

Examples

#import "std/tz"
#import "std/tzdata"
#import "std/chrono"
using tz
dim as TimeZone paris = TimeZone.FindById( "europe/paris" )
print paris.Id      '' Europe/Paris

Library: Time Zones (std/tz)
Category: Time Zones
Documented under: TimeZone

Clone this wiki locally