question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing ISO8601 DateTime with time zones formatted as "+0000"

See original GitHub issue

Parsing a string as an Instant like 2021-08-22T03:32:10+0000 fails due to fixOffsetRepresentation adding :00 to the end of the string.

The underlying Java Time library is able to handle this fine.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ilya-gcommented, Oct 14, 2021

@merlin-zaraza Currently there’s no way to parse such values because Instant.parse doesn’t support this format. Later, when we implement custom formatting and parsing (see #58, #39), you’ll be able to parse such values with a custom format pattern.

You can work around it currently by transforming an input value to the format Instant.parse supports, i.e. by inserting a : between hours and minutes in the offset designator part.

0reactions
micbakoscommented, Jan 12, 2022

Thank you @dkhalanskyjb for the snippet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ISO 8601 date-time format combining 'Z' and offset of '+0000'
No, the Z is an offset-from-UTC so it should not be combined redundantly with a numerical offset of +00:00 or +0000 . ISO...
Read more >
Formatting and parsing dateTimes as strings - IBM
This section gives information on how you can specify the dateTime format using a string of pattern letters.
Read more >
DateTimeFormatter (Java Platform SE 8 ) - Oracle Help Center
This returns an immutable formatter capable of formatting and parsing the ISO-8601 extended offset time format. The format consists of:
Read more >
Class: Time (Ruby 2.5.1)
Parses date as a dateTime defined by the XML Schema and converts it to a Time object. The format is a restricted version...
Read more >
Time handling | Dev Cheatsheets - Michael Currin
So when datetime.utcnow method is run, that gives the time at GMT+0000, ... Use ISO-8601 format: ... Parse ISO 8061 format date and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found