Standard library / log/slog
slog.Value.Time()
Return the represented Time value; typed accessors require the appropriate Kind (String and Any have broader behavior). Expected stdout: '1970-01-01 00:00:00 +0000 UTC\n'.
Formal Syntax & Structure
go syntaxgo
func (v Value) Time() time.TimeReturn Value
time.Time
Return the represented Time value; typed accessors require the appropriate Kind (String and Any have broader behavior).
Working Example
Example Snippetgo
package main
import ( "fmt" "log/slog" "time")
func main() { fmt.Println(slog.TimeValue(time.Unix(0, 0).UTC()).Time()) }