You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Output a datetime as a string with an ordinal number (example from README.md)
fmt.Println(carbon.Parse("2020-08-05 13:14:15").Format("l jK \\o\\f F Y h:i:s A"))
// Wednesday 5th of August 2020 01:14:15 PM
// Parsing that output doesn't seem to work
fmt.Println(carbon.ParseByFormat("Wednesday 5th of August 2020 01:14:15 PM", "l jK \\o\\f F Y h:i:s A"))
// Nothing
// If we simply remove the ordinal (e.g. the K) it works!
fmt.Println(carbon.ParseByFormat("Wednesday 5 of August 2020 01:14:15 PM", "l j \\o\\f F Y h:i:s A"))
// Wednesday 5 of August 2020 01:14:15 PM
golang version: 1.24.2
carbon version: 2.6.4
time zone: United States
Please see the above example. Looks like carbon is able to format a datetime using ordinals but it is unable to parse a string that has ordinals.
The text was updated successfully, but these errors were encountered:
Hello,
I encountered an issue with the following code:
golang version: 1.24.2
carbon version: 2.6.4
time zone: United States
The text was updated successfully, but these errors were encountered: