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

DateFormat.jm().parse failed in signed and enterprise build #72

Closed
mehtahardikr opened this issue Jun 1, 2021 · 2 comments
Closed

DateFormat.jm().parse failed in signed and enterprise build #72

mehtahardikr opened this issue Jun 1, 2021 · 2 comments

Comments

@mehtahardikr
Copy link

mehtahardikr commented Jun 1, 2021

DateTime date =DateFormat("hh:mm a").parse('10:00');

Unhandled Exception: FormatException: Trying to read   from 10:00 at position 6
    #0      _DateFormatField.throwFormatException (package:intl/src/intl/date_format_field.dart:86)
    dart-lang/intl#1      _DateFormatField.parseLiteral (package:intl/src/intl/date_format_field.dart:55)
    dart-lang/intl#2      _DateFormatQuotedField.parse (package:intl/src/intl/date_format_field.dart:118)
    dart-lang/intl#3      DateFormat._parse (package:intl/src/intl/date_format.dart:394)
    dart-lang/intl#4      DateFormat.parse (package:intl/src/intl/date_format.dart:325)
@lordvidex
Copy link

The value you are trying to parse doesn't follow the format defined. You could solve this issue like this:

1. DateTime date = DateFormat('hh:mm a').parse('10:00 AM');  // 'a' stands for am/pm marker 
2. DateTime date = DateFormat('hh:mm').parse('10:00'); // remove the am/pm marker altogether

@mosuem
Copy link
Member

mosuem commented Oct 12, 2022

I assume this solved the issue - if not, please reopen!

@mosuem mosuem closed this as completed Oct 12, 2022
@mosuem mosuem transferred this issue from dart-archive/intl Apr 18, 2023
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

3 participants