Lesson 35 of 60
GoTime Package – Parsing, Formatting, and Timers
15 minutes
Course progress58%
Working with Time
This lesson explains the main concept clearly with beginner-friendly examples and background so you can learn why the code works.
now := time.Now()
fmt.Println(now.Format(time.RFC3339))
// Parse ISO‑8601
t, err := time.Parse(time.RFC3339, "2024-03-25T12:34:56Z")
// Timer & After
timer := time.NewTimer(2 * time.Second)
<-timer.C // blocks for 2 s