Standard library / time
time.Time.After()
Report whether t is strictly later than u. Both monotonic readings are used when present; otherwise compare wall instants. Expected stdout: 'true false\n'.
Formal Syntax & Structure
go syntaxgo
func (t Time) After(u Time) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| u | Time | Other instant for comparison or subtraction. |
Return Value
bool
Report whether t is strictly later than u.
Working Example
Example Snippetgo
package main
import ( "fmt" "time")
func fixed() time.Time { return time.Date(2024, 2, 29, 12, 34, 56, 123000000, time.UTC) }func main() { t := fixed(); fmt.Println(t.Add(time.Second).After(t), t.After(t)) }