-
Notifications
You must be signed in to change notification settings - Fork 254
Description
It appears that the fromMillis is not respecting the timezone parameter. The docs say that it should default to UTC, but it appears to default to the system/browser timezone. Also you can not manually set the timezone.
Example JSONata expression: http://try.jsonata.org/rymaAsdZ8
[
$fromMillis(1514808000000, 'Week: [w] of [xNn]'),
$fromMillis(1514808000000, 'Week: [w] of [xNn]', "+0000"),
$fromMillis(1514808000000, 'Week: [w] of [xNn]', "+0900")
]
Expected result
[
"Week: 1 of January",
"Week: 1 of January",
"Week: 5 of December"
]Actual result
[
"Week: 5 of December",
"Week: 5 of December",
"Week: 5 of December"
]This is causing tests the fail when they are run in other timezones, and likely causing incorrect results for anyone using the fromMillis function.
Also related to #347 and the lack of daylight-savings-time support.
aside I think that this should probably get patched, but also might want to direct people to using their system-native functions for formatting, like the Intl browser API and Luxon or moment.js. Datetime processing is notoriously difficult to get right.