2026-08-18
Daily Tech Challenge
What does this Go program print, given what time.Time.Truncate rounds down to?
package main
import (
"fmt"
"time"
)
func main() {
t := time.Date(2026, time.August, 18, 15, 47, 33, int(250*time.Millisecond), time.UTC)
fmt.Println(t.Truncate(time.Second).Format("15:04:05.000"))
fmt.Println(t.Truncate(24 * time.Hour).Format("2006-01-02 15:04:05"))
}Tuesday, August 18, 2026 · A new challenge drops every day