Skip to content

Format issue: wrong timezone name #1117

@AlimovSV

Description

@AlimovSV

Environment

{
  moment: '2.30.1',
  momentTz: '0.5.45',
  date: 'Fri Sep 20 2024 15:50:16 GMT+0400 (Самарское стандартное время)',
  intlZone: 'Europe/Samara'
}

Issue description

>  moment.updateLocale('en-au')
...
>  moment('2023-04-17T20:47:08.962599+08:45').tz('Australia/Eucla').format('lll z')
'Apr 17, 2023 8:47 PM +0845'

formatted zone name is +0845 but expected ACWST

> Intl.DateTimeFormat("en-AU", {
...   timeZone: "Australia/Eucla",
...   day: "numeric",
...   month: "short",
...   year: "numeric",
...   hour: "numeric",
...   minute: "numeric",
...   timeZoneName: "short"
... }).format(new Date('2023-04-17T20:47:08.962599+08:45'))
'17 Apr 2023, 8:47 pm ACWST'

Looks like the problem is in the timezone definitions:

{
  name: 'Australia/Eucla',
  abbrs: [
    'LMT',   '+0845', '+0945',
    '+0845', '+0945', '+0845',
    '+0945', '+0845', '+0945',
    '+0845', '+0945', '+0845',
    '+0945', '+0845', '+0945',
    '+0845', '+0945', '+0845',
    '+0945', '+0845'
  ],
  untils: [
    -2337928528000, -1672555500000,
    -1665384300000,  -883637100000,
     -876120300000,  -860395500000,
     -844670700000,   152039700000,
      162926100000,   436295700000,
      447182100000,   690311700000,
      699383700000,  1165079700000,
     1174756500000,  1193505300000,
     1206810900000,  1224954900000,
     1238260500000,       Infinity
  ],
  offsets: [
    -515.4666666666667, -525,
                  -585, -525,
                  -585, -525,
                  -585, -525,
                  -585, -525,
                  -585, -525,
                  -585, -525,
                  -585, -525,
                  -585, -525,
                  -585, -525
  ],
  population: 368
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions