Standard library / time

time.Time.String()

Return a debugging representation including zone and possibly monotonic data. Use Format for stable protocol output. Expected stdout: '2024-02-29 12:34:56.123 +0000 UTC\n'.

Formal Syntax & Structure

go syntaxgo
func (t Time) String() string

Return Value

string

Return a debugging representation including zone and possibly monotonic data.

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()            { fmt.Println(fixed().String()) }
Go Reference