-
-
Notifications
You must be signed in to change notification settings - Fork 261
Milliseconds and microseconds formatting regression in carbon v2.6 #328
Copy link
Copy link
Closed
Labels
BugReport a reproducible bug or regressionReport a reproducible bug or regression
Description
Hello,
After upgrading form v2.5.2 to 2.6.15, I encountered an issue with the following code:
inputTime := time.Date(2026, 1, 22, 11, 30, 52, 624_225_666, time.UTC)
c := carbon.CreateFromStdTime(inputTime)
fmt.Println(c.Format("Y-m-d H:i:s.v"))
fmt.Println(inputTime.Format("2006-01-02 15:04:05.999"))
fmt.Println(c.Format("Y-m-d H:i:s.u"))
fmt.Println(inputTime.Format("2006-01-02 15:04:05.999999"))golang version: 1.25.0
carbon version: v2.6.15
time zone: *Europe/Paris (tests in UTC)
I expected to get:
2026-01-22 11:30:52.624
2026-01-22 11:30:52.624
2026-01-22 11:30:52.624225
2026-01-22 11:30:52.624225
But I actually get:
2026-01-22 11:30:52.624
2026-01-22 11:30:52.999999
2026-01-22 11:30:52.624225
2026-01-22 11:30:52.999
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugReport a reproducible bug or regressionReport a reproducible bug or regression