Skip to content
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

Feature Request: Parse Instant from complex pattern #39

Closed
Brutus5000 opened this issue Aug 19, 2020 · 1 comment
Closed

Feature Request: Parse Instant from complex pattern #39

Brutus5000 opened this issue Aug 19, 2020 · 1 comment
Labels
formatters Related to parsing and formatting
Milestone

Comments

@Brutus5000
Copy link

Brutus5000 commented Aug 19, 2020

Use case:
I am working with timeseries data coming from

  • sensors of all sorts of types and vendors
  • business files (e.g. Excel exports in all kind of localizations and formats)
  • output from other systems in all sorts of formats.

From my experience the amount of variations is almost unlimited. Be it the separators (or sometimes the lack of), the order of the elements and also the potential absence of some parts (optionally millisecond fractions, optionally offsets minutes, ...). The requirement goes way beyond what you can usually represent as a string pattern with describing string like ("yyyy-MM-dd") which are fairly unreadable as well if you think about the amount of variables for non-standard-stuff (fractions, timezone hour, timezone minute, ...)

Reference solution:
Coming from Java, all of these formats can be easily represented using a DateTimeFormatter and described using a DateTimeFormatterBuilder. The DateTimeFormatter offers a lot of predefined ISO formats as well.

Side note: The DateTimeFormatter can be used for printing instants as well.

Summary:
A comprehensive datetime library needs utilities to allow import and export of date/time strings in all formats for compatibility with the rest of the world.

@tylerwilson
Copy link

Agreed. I deal with an old REST API that has something like 8 different date and time formats I need to parse. So a generic formatting option, to and from String, is needed in my case.

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

Successfully merging a pull request may close this issue.

4 participants
@tylerwilson @Brutus5000 @dkhalanskyjb and others