Skip to content

[iOS] Fix parsing string without seconds #375

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

Closed
romanyczn1 opened this issue Apr 1, 2024 · 1 comment
Closed

[iOS] Fix parsing string without seconds #375

romanyczn1 opened this issue Apr 1, 2024 · 1 comment

Comments

@romanyczn1
Copy link

On ios im getting an exception when trying to Instant.parse string without seconds "Failed to parse an instant from '2024-04-01T15:30+03:00'" "Position 16: Expected : but got +"

On android it's behave normally

How can i resolve this?

@dkhalanskyjb
Copy link
Collaborator

Duplicate of #369
You can resolve this by defining a custom format:

val format = DateTimeComponents.Format {
  dateTime(LocalDateTime.Formats.ISO)
  offset(UtcOffset.Formats.ISO)
}
Instant.parse("2024-04-01T15:30+03:00", format)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants