🌐
Go Packages
pkg.go.dev › time
time package - time - Go Packages
Package time provides functionality for measuring and displaying time.
🌐
Go by Example
gobyexample.com › time
Go by Example: Time
Go offers extensive support for times and durations; here are some examples · We’ll start by getting the current time
🌐
Soham Kamani
sohamkamani.com › golang › time
Time in Golang - Working With Time, Duration, and Dates (With Examples)
This tutorial will teach you how to work with Time in Go (Golang) - including how to parse and format date-time strings, add and subtract time durations, get the current system time, and handle time zones effectively.
🌐
ByteSizeGo
bytesizego.com › blog › golang-time
Working With Time in Golang
September 19, 2024 - Here, time.Now() returns the current local time, including the date, hour, minute, second, and nanoseconds.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-use-dates-and-times-in-go
How To Use Dates and Times in Go | DigitalOcean
February 2, 2022 - Date and time values show up everywhere in modern software. Learn to use Go’s time package to get the current local time of your computer and customize the f…
🌐
Willem.dev
willem.dev › articles › time-location-explained
Time and Location Explained in Go/Golang - Willem.dev
December 21, 2023 - Learn how to think about time in Go. This article shows you how both types work together to represent moments in time.
🌐
Go
go.dev › src › time › time.go
time.go
89 // On older Windows versions, ... 93 import ( 94 "errors" 95 "math/bits" 96 _ "unsafe" // for go:linkname 97 ) 98 99 // A Time represents an instant in time with nanosecond precision....
Find elsewhere
🌐
DEV Community
dev.to › jpoly1219 › time-in-go-jlc
Working with Time Data in Go - DEV Community
February 9, 2023 - Working with time data in Go requires you to import the time package from the Go standard library. This package has a lot of methods and types that you can use, but I took the most used ones and described them here in this post.
🌐
UBC Computer Science
cs.ubc.ca › ~bestchai › teaching › cs416_2015w2 › go1.4.3-docs › pkg › time › index.html
time - The Go Programming Language
Package time provides functionality for measuring and displaying time · The calendrical calculations always assume a Gregorian calendar
🌐
Kyle Redelinghuys
ksred.com › golang-time-handling-from-basics-to-production-patterns
Golang Time Handling: Complete Guide to Production Patterns
August 1, 2025 - Master Go's time package with practical examples: scheduling, rate limiting, database timeouts, and parsing. Production patterns that work.
🌐
Go
go.dev › src › time › format.go
Time.Format
193 // 194 // nextStdChunk should be an internal detail, 195 // but widely used packages access it using linkname. 196 // Notable members of the hall of shame include: 197 // - github.com/searKing/golang/go 198 // 199 // Do not remove or change the type signature.
🌐
Go
go.dev › src › runtime › time.go
Time-related runtime and pieces of package time.
6 7 package runtime 8 9 import ( 10 "internal/abi" 11 "internal/runtime/atomic" 12 "internal/runtime/sys" 13 "unsafe" 14 ) 15 16 //go:linkname time_runtimeNow time.runtimeNow 17 func time_runtimeNow() (sec int64, nsec int32, mono int64) { 18 if bubble := getg().bubble; bubble != nil { 19 sec = bubble.now / (1000 * 1000 * 1000) 20 nsec = int32(bubble.now % (1000 * 1000 * 1000)) 21 // Don't return a monotonic time inside a synctest bubble.
🌐
Go
go.dev › src › time › example_test.go
round := []time.Duration
2*time.Minute + 300*time.Millisecond) 55 fmt.Println(300 * time.Millisecond) 56 // Output: 57 // 1h2m0.3s 58 // 300ms 59 } 60 61 func ExampleDuration_Truncate() { 62 d, err := time.ParseDuration("1h15m30.918273645s") 63 if err != nil { 64 panic(err) 65 } 66 67 trunc := []time.Duration{ 68 time.Nanosecond, 69 time.Microsecond, 70 time.Millisecond, 71 time.Second, 72 2 * time.Second, 73 time.Minute, 74 10 * time.Minute, 75 time.Hour, 76 } 77 78 for _, t := range trunc { 79 fmt.Printf("d.Truncate(%6s) = %s\n", t, d.Truncate(t).String()) 80 } 81 // Output: 82 // d.Truncate( 1ns) = 1h15m30.91827364
🌐
Reddit
reddit.com › r/golang › the docs for go's time package jump straight into the deep end. i wrote this article as a (hopefully!) more approachable intro to time and location.
r/golang on Reddit: The docs for Go's time package jump straight into the deep end. I wrote this article as a (hopefully!) more approachable intro to Time and Location.
December 21, 2023 - What happened to Go Time podcast? r/golang • · upvotes · · comments · How to format time in Go/Golang? r/golang • · upvotes · · comments · Timekit – Helpful functions to extend the Go `time` standard package · r/golang • · upvotes · · comments · Get current time from monotonic clock source ·
🌐
Honeybadger
honeybadger.io › blog › complete-guide-to-dates-and-times-in-go
The complete guide to dates and times in Go - Honeybadger Developer Blog
August 17, 2023 - In the following sections, we will explore how to use this package to perform various date and time tasks in Go, such as parsing and formatting dates, calculating durations, working with time zones, and handling date arithmetic.
🌐
ZetCode
zetcode.com › golang › datetime
Working with Date and Time in Go
May 4, 2025 - Learn how to work with date and time in Go. Includes examples of parsing and formatting.
🌐
YourBasic
yourbasic.org › golang › format-parse-string-time-date-example
Format a time or date [complete guide] · YourBasic Go
ANSIC = "Mon Jan _2 15:04:05 2006" UnixDate = "Mon Jan _2 15:04:05 MST 2006" RubyDate = "Mon Jan 02 15:04:05 -0700 2006" RFC822 = "02 Jan 06 15:04 MST" RFC822Z = "02 Jan 06 15:04 -0700" RFC850 = "Monday, 02-Jan-06 15:04:05 MST" RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST" RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" RFC3339 = "2006-01-02T15:04:05Z07:00" RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00" Kitchen = "3:04PM" // Handy time stamps.