clojure.java-time icon indicating copy to clipboard operation
clojure.java-time copied to clipboard

Canadian locale doesn't support AM/PM?

Open ronnyli opened this issue 2 years ago • 1 comments

(local-date-time "M/d/yyyy h:mm:ss a" "1/3/2022 3:58:29 PM")

Execution error (DateTimeParseException) at java.time.format.DateTimeFormatter/parseResolved0 (DateTimeFormatter.java:2051).
Text '1/3/2022 3:58:29 PM' could not be parsed at index 17

Some sleuthing in the Clojurians slack discovered that it has to do with the Canadian locale (link)

ronnyli avatar Aug 31 '23 01:08 ronnyli

Can you post your solution? I'm guessing you followed this advice?

henryw374: Set the locale on the formatter itself rather than relying on ambient default

frenchy64 avatar Nov 16 '23 21:11 frenchy64