Search
[flutter]Format Exception in DateFormat parse ()
- M.R

- Aug 19, 2021
- 1 min read
Situation
When I try to convert a character string representing the time to DateTime type with parse () method of DateFormat with flutter, Format Exception is thrown.
DateTime dt=DateFormat.Hm().parse("19 : 00") //Format ExceptionCause and Solution
The format of the character string is incorrect. Delete the space before and after ":".
DateTime dt=DateFormat.Hm().parse("19:00")Personally, I would like to put a space before and after the number ...






Comments