---
source: https://iinventedlight.com/library/notes/go-time.md
title: "Go time: measure and display clocks and durations"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (Go docs); BSD-3-Clause (Go source); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Go docs, time package; Go source, time.go. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go time"
tags: [go, time, duration, clock, sleep]
client: Librarian
sources:
  - id: S1
    title: "time package"
    publisher: Go docs
    url: https://pkg.go.dev/time
    accessed: 2026-11-18
    license: "BSD-3-Clause"
  - id: S2
    title: "time.go"
    publisher: Go source
    url: https://raw.githubusercontent.com/golang/go/master/src/time/time.go
    accessed: 2026-11-18
    license: "BSD-3-Clause"
---
# Go time: measure and display clocks and durations
**Answer:** The time package measures and displays time. Its calendrical calculations assume a Gregorian calendar in all cases. Add adds the same duration to both the wall clock and monotonic clock readings. Sleep pauses the current goroutine.

## Examples

```go
package main
import "time"

func main() {
    now := time.Now()
    later := now.Add(2 * time.Second)
    time.Sleep(10 * time.Millisecond)
    _ = later.Sub(now)
}
```

## Notes

The zero Time value does not format as a normal date. On some systems the clock can stop if the computer goes to sleep, and Sub may not accurately reflect the actual time that passed. Duration values such as Second are used with Add and Sleep.

## Reference list

- `The` time package measures and displays time.
- `Calendrical` calculations assume a Gregorian calendar.
- `Add` applies the duration to both wall clock and monotonic readings.

## See also

- [go-context](https://iinventedlight.com/library/notes/go-context/)
- [go-goroutines-channels](https://iinventedlight.com/library/notes/go-goroutines-channels/)
- [go-error-handling](https://iinventedlight.com/library/notes/go-error-handling/)

## Claims

- id: C1
  claim: The time package measures and displays time.
  source: S1
  evidence: "Package time provides functionality for measuring and displaying time"

- id: C2
  claim: Calendrical calculations assume a Gregorian calendar.
  source: S2
  evidence: "The calendrical calculations always assume a Gregorian calendar"

- id: C3
  claim: Add applies the duration to both wall clock and monotonic readings.
  source: S2
  evidence: "t.Add adds the same duration to // both the wall clock and monotonic clock readings"

## Sources

- [S1] time package. Go docs. https://pkg.go.dev/time . License: BSD-3-Clause. Accessed 2026-11-18.

- [S2] time.go. Go source. https://raw.githubusercontent.com/golang/go/master/src/time/time.go . License: BSD-3-Clause. Accessed 2026-11-18.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Go docs, time package; Go source, time.go. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
