JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • time.Time and time.Duration: instants and intervals

    Go SELF
    34 level,0 lecture
    We break down two different meanings of “time” in Go: an instant ( time.Time) and a duration ( time.Duration). We learn how to get “now” via time.Now(), create a fixed date via time.Date(), check “time not set” with IsZero(), specify intervals correctly ( 150 * time.Millisecond), and do “proper math” with time via Add/ Sub and the measurement idiom time.Since.
    Open
  • time.Since, Add/Sub, time comparisons, UTC vs local

    Go SELF
    34 level,1 lecture
    We break down “time arithmetic” in Go: how to shift a moment correctly with Add, get a duration with Sub, measure “how much time has passed” with time.Since and “how much time is left” with time.Until. Separately—safe moment comparisons with Before/ After/ Equal and an important idea: UTC vs Local is about representation, not about changing the event.
    Open
  • Layout formatting and time parsing in Go

    Go SELF
    34 level,2 lecture
    We break down how to convert time.Time to a string and back in Go: the “magic” layout (a template based on a reference date), formatting via t.Format, parsing via time.Parse and time.ParseInLocation, and why it’s beneficial to use time.RFC3339 for the “machine world.” At the end: a practical example and a list of common mistakes (about "YYYY-MM-DD", mixing up 04/ 05, ignoring error, and time zones).
    Open
  • Timers and tickers — time.After, time.NewTicker

    Go SELF
    34 level,3 lecture
    We break down how to wait in Go “for a time event” rather than just “pause”: a one-shot timer via time.After and regular ticks via time.NewTicker. In practice, we will see that both tools return a time channel ( <- chan time.Time), learn to read an event with the <- operator, properly stop a ticker via defer ticker . Stop (), and discuss common mistakes (forgot to read from the channel, did not stop the ticker, expected perfect accuracy, confused a timeout with cancellation via context).
    Open
  • Timeouts in code: where context.WithTimeout belongs

    Go SELF
    34 level,4 lecture
    We break down the difference between “pause and continue” and “the operation must meet a deadline”: when time.After (a delay) is appropriate, and when you need context.WithTimeout (a deadline as part of the contract). We also cover cooperative cancellation via ctx.Err(), the mandatory defer cancel(), an example using the mini app notebox, and correct timeout error handling via errors.Is and context.DeadlineExceeded.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush