-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
localDatetime timezone discrepancy in iso8601 format #648
Comments
@rdhar nice catch, I have fixed it, and before I publish a new version, you can try the format like following to achieve this |
Thanks for such a prompt response, @Huachao, really appreciate it! Current behaviour is as follows:
This is much closer to the expected value, with exception to the missing timezone signage i.e., I understand you're using Day.js, where the relevant docs page for Local time appears to suggest that a signed timezone is possible with: dayjs.extend(utc);
var a = dayjs.utc();
a.format(); // 2019-03-06T00:00:00Z
a.local().format(); //2019-03-06T08:00:00+08:00 Wonder if this would be possible to leverage the output for |
@rdhar I will use your suggestion, however, the format |
Oh, in that case, I wonder if the issue is on my end. Sorry if I've caused a hassle, I'll double-check my output to be sure. What's your output for EDIT: Double-checked to find I was reading the output incorrectly. I'm sorry about the confusion! When the variables are sent as query parameters, signs are removed/replaced with whitespace. Presumably, this is part of URL encoding(?). Here's the correct behaviour output altogether:
Where |
@rdhar you can try the latest version 0.24.2 |
Summary
There is no difference in output between
datetime
andlocalDatetime
iniso8601
format. I would expect the local timezone to be taken into account forlocalDateTime
.Replication Steps
Using PostBin as a free API client to test requests using this script:
Expected Behavior
In the UK, which is currently observing UTC +1 timezone.
$datetime
iso8601
2020-07-28T14:30:00.000Z
$localDatetime
iso8601
2020-07-28T15:30:00.000+01:00
Actual Behavior
In the UK, which is currently observing UTC +1 timezone.
$datetime
iso8601
2020-07-28T14:30:00.000Z
$localDatetime
iso8601
2020-07-28T14:30:00.000Z
For comparison, this difference is reflected correctly in
rfc1123
format.$datetime
rfc1123
Tue, 28 Jul 2020 14:30:00 GMT
$localDatetime
rfc1123
Tue, 28 Jul 2020 15:30:00 0100
Thanks for your time and effort for this extension and wish you the best with development on #628!
Version
The text was updated successfully, but these errors were encountered: