Standard library / time

time.Month

Calendar month number; January is 1 and December is 12. Integer conversions may produce invalid values. Expected stdout: '2\n'.

Formal Syntax & Structure

go syntaxgo
type Month int

Working Example

Example Snippetgo
package main
import (  "fmt"  "time")
func main() { var m time.Month = time.February; fmt.Println(int(m)) }
Go Reference