localDatetime timezone discrepancy in iso8601 format
See original GitHub issueSummary
There is no difference in output between datetime
and localDatetime
in iso8601
format. I would expect the local timezone to be taken into account for localDateTime
.
Replication Steps
Using PostBin as a free API client to test requests using this script:
POST https://postb.in/###?
&iso8601_datetime={{$datetime iso8601}}
&iso8601_localDatetime={{$localDatetime iso8601}}
&rfc1123_datetime={{$datetime rfc1123}}
&rfc1123_localDatetime={{$localDatetime rfc1123}}
Expected Behavior
In the UK, which is currently observing UTC +1 timezone.
Variable | Format | Result |
---|---|---|
$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.
Variable | Format | Result |
---|---|---|
$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.
Variable | Format | Result |
---|---|---|
$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
REST Client | VS Code | OS |
---|---|---|
v0.24.1 | v1.47.3 | Windows 10 v2004 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
LocalDateTime is not ISO8601 by default - Stack Overflow
If there is no timezone, ISO-8601 assumes "local time." Given that the class is LocalDateTime , that representation makes sense.
Read more >Working with Dates and Times By Using the ISO 8601 Basic ...
The datetime value is written for this time zone ID by using the E8601DX w. format. The time zone offset is the difference...
Read more >Convert between LocalDateTime and ZonedDateTime
An instance of LocalDateTime represents a date-time (to nanosecond precision.) without a time-zone in the ISO-8601 calendar system. A ...
Read more >ISO 8601 Date time Corticon.js serverless mobile
ISO 8601 Formats ISO 8601 represents date and time by starting with the year, followed by the month, the day, the hour, the...
Read more >ISO 8601 - Wikipedia
The standard does not assign specific meaning to any element of the dates/times represented: the meaning of any element depends on the context...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rdhar nice catch, I have fixed it, and before I publish a new version, you can try the format like following to achieve this
{{$localDatetime 'YYYY-MM-DDTHH:mm:ss.SSSZ'}}
with a specified format string.@rdhar I will use your suggestion, however, the format
YYYY-MM-DDTHH:mm:ss.SSSZ
works on my machine