Standard library / time

time.Time.Weekday()

Return the weekday in the associated location. Expected stdout: 'Thursday\n'.

Formal Syntax & Structure

go syntaxgo
func (t Time) Weekday() Weekday

Return Value

Weekday

Return the weekday in the associated location.

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().Weekday()) }
Go Reference