dayjs icon indicating copy to clipboard operation
dayjs copied to clipboard

When the time zone of the Windows operating system is set to the America/Asuncion time zone, the time zone offset error is one hour.

Open xingyixiang opened this issue 10 months ago • 8 comments

Describe the bug When the time zone of the Windows operating system is set to the America/Asuncion time zone, the time zone offset error is one hour. Daylight Saving Time: UTC-3 Standard Time: UTC-4

Windows操作系统时区设置为(UTC-04:00) 亚松森 时区,时区偏移量误差1小时。 夏令时是:UTC-3 标准时间是:UTC-4

it('test America/Asuncion', () => {
  const testDate = dayjs.utc('2025-03-23T03:20:57.000+00:00').tz('America/Asuncion').format('YYYY-MM-DD HH:mm:ssZ')
  expect(testDate).toBe('2025-03-22 23:20:57-04:00')
})

Result 2025-03-22 23:20:57-05:00

Expected behavior 2025-03-22 23:20:57-04:00

Information

  • Day.js Version - 1.11.13
  • windows 10
  • Browser [chrome 132.0.6834.84]
  • Time zone: [GMT-04:00 DST (America/Asuncion)]

xingyixiang avatar Mar 05 '25 02:03 xingyixiang

Image Image

xingyixiang avatar Mar 06 '25 13:03 xingyixiang

FYI On october 2024 the Congress of Paraguay passed a bill to observe UTC-3 permanently, equivalent to permanent DST

https://lists.iana.org/hyperkitty/list/[email protected]/thread/LXAN4PAEWYEWQJVYGSJ5NPIWWYQ2NHFZ/

fformigli avatar Mar 06 '25 15:03 fformigli

FYI On october 2024 the Congress of Paraguay passed a bill to observe UTC-3 permanently, equivalent to permanent DST

https://lists.iana.org/hyperkitty/list/[email protected]/thread/LXAN4PAEWYEWQJVYGSJ5NPIWWYQ2NHFZ/

Therefore, the calculation should be UTC-3 or UTC-4 instead of UTC-5.

xingyixiang avatar Mar 06 '25 15:03 xingyixiang

I got -4 https://codesandbox.io/p/sandbox/htxgsy Image

Qiming-Liu avatar Mar 12 '25 03:03 Qiming-Liu

I got -4 https://codesandbox.io/p/sandbox/htxgsy Image

Set the time zone of the Windows operating system to be the same as the time zone to be tested.

xingyixiang avatar Mar 12 '25 03:03 xingyixiang

Can the problem be reproduced? @Qiming-Liu

xingyixiang avatar Mar 12 '25 03:03 xingyixiang

Yeah, I think it is the same as https://github.com/iamkun/dayjs/issues/2303

Qiming-Liu avatar Mar 13 '25 04:03 Qiming-Liu

Yeah, I think it is the same as #2303

It's the same problem

xingyixiang avatar Mar 13 '25 06:03 xingyixiang