For AI agents: the complete documentation index is available at /tc39-atlas/en/llms.txt, the full documentation bundle is available at /tc39-atlas/en/llms-full.txt, and this page is available as Markdown at /tc39-atlas/en/proposals/stage/4/proposal-intl-extend-timezonename.md.
  • English
  • Extend TimeZoneName Option Proposal S4

    Proposal details
    Proposal overview

    This proposal extends the timeZoneName option in Intl.DateTimeFormat to support four new formats: shortOffset, longOffset, shortGeneric, and longGeneric, beyond the existing short and long. It aims to provide more flexible time zone display options as defined in UTS35.

    Note

    The README below comes from the upstream repository and may contain outdated stage or status metadata. Use the proposal details above as the current source of truth.

    Extend TimeZoneName Option Proposal

    Stage

    Stage 3

    Champion

    • Frank Tang @FrankYFTang

    Stage 3 reviewers (needed during stage 2)

    • Philip Chimento @ptomato
    • Rick Button @rickbutton

    Editor

    • TBD

    Scope

    Extend the timeZoneName option in Intl.DateTimeFormat object to support more formatted options.

    Background

    Prior Discussion: ECMA402#119 DateTimeFormat: consider adding more timezone display options

    Ref: UTS35 - "7 Using Time Zone Names"

    Updated Proposal - add 4 new formats only

    timeZoneNameCLDR patternExamplesDescription in UTS35ICU keyTotal # of items in 476 localesTotal bytes in UTF8Compressed Size
    shortOffsetOGMT-8The short localized GMT format.zone/*/zoneStrings/gmt.*Format2631826392
    longOffsetOOOOGMT-0800The long localized GMT format.(same as above)(no extra from above)(no extra from above)(no extra from above)
    shortGenericvPTThe short generic non-location format.zone/*/zoneStrings/meta:*/sg3321719311
    longGenericvvvvPacific TimeThe long generic non-location format.zone/*/zoneStrings/meta:*/lg1004727810369526

    Note: Here is how I get the above number

    $ cd icu/icu4c/source/data/zone
    $ egrep "sg\{" *|cut -d\" -f2 |wc
        332     333    1719
    $ egrep "sg\{" *|cut -d\" -f2 | gzip -f |wc -c
    311
    $ egrep "lg\{" *|cut -d\" -f2 |wc 
      10047   24026  278103 
    $ egrep "lg\{" *|cut -d\" -f2 | gzip -f |wc -c
    69526
    $ egrep "gmt.*Format\{" *|cut -d\" -f2 |wc
        263     284    1826
    $ egrep "gmt.*Format\{" *|cut -d\" -f2 | gzip -f |wc -c
    392

    Tracking

    Output from V8 of the updated proposal

    $ out/x64.release/d8 --harmony_intl_more_timezone
    V8 version 8.9.0 (candidate)
    d8> let timeZoneNames = ["short", "long", "shortOffset", "longOffset", "shortGeneric", "longGeneric"];
    d8> timeZoneNames.forEach(function(timeZoneName) { print(timeZoneName + ": " + (new Date()).toLocaleTimeString("en", {timeZoneName}))});
    d8> timeZoneNames.forEach(function(timeZoneName) { print(timeZoneName + ": " + (new Date()).toLocaleTimeString("en", {timeZoneName}))});
    short: 12:27:10 PM PST
    long: 12:27:10 PM Pacific Standard Time
    shortOffset: 12:27:10 PM GMT-8
    longOffset: 12:27:10 PM GMT-08:00
    shortGeneric: 12:27:10 PM PT
    longWall: 12:27:10 PM Pacific Time
    
    
    d8> timeZoneNames.forEach(function(timeZoneName) { print(timeZoneName + ": " + (new Date()).toLocaleTimeString("zh-Hant", {timeZoneName}))});
    short: 下午12:26:20 [PST]
    long: 下午12:26:20 [太平洋標準時間]
    shortOffset: 下午12:26:20 [GMT-8]
    longOffset: 下午12:26:20 [GMT-08:00]
    shortGeneric: 下午12:26:20 [PT]
    longGeneric: 下午12:26:20 [太平洋時間]
    
    
    d8> timeZoneNames.forEach(function(timeZoneName) { print(timeZoneName + ": " + (new Date()).toLocaleTimeString("en", {timeZoneName, timeZone: "Asia/Calcutta"}))});
    short: 1:54:56 AM GMT+5:30
    long: 1:54:56 AM India Standard Time
    shortOffset: 1:54:56 AM GMT+5:30
    longOffset: 1:54:56 AM GMT+05:30
    shortGeneric: 1:54:56 AM India Time
    longGeneric: 1:54:56 AM India Standard Time
    

    See possible options removed due to size concern in archived README.md

    Stage Advancement Planning

    Entrance Criteria For Stage 2

    Entrance Criteria For Stage 1

    • Identified “champion” who will advance the addition: DONE- @FrankYFTang
    • Prose outlining the problem or need and the general shape of a solution DONE
    • Illustrative examples of usage DONE
    • High-level API DONE
    • Discussion of key algorithms, abstractions and semantics DONE
    • Identification of potential “cross-cutting” concerns and implementation challenges/complexity DONE
    • A publicly available repository for the proposal that captures the above requirements: DONE https://github.com/tc39/proposal-intl-extend-timezonename/
    • Acceptance Signifies: “The committee expects to devote time to examining the problem space, solutions and cross-cutting concerns”