Standard library / time

time.January

Named month constant representing January; numeric value 1. Prefer the name to a magic number. Expected stdout: 'January 1\n'.

Formal Syntax & Structure

go syntaxgo
const January Month = 1

Working Example

Example Snippetgo
package main
import (  "fmt"  "time")
func main() { fmt.Println(time.January, int(time.January)) }
Go Reference