Month in Go

Posted by GoDoc
Public (Editable by Users)

A Month specifies a month of the year (January = 1, ...).

Go
Edit
package main

import (
	"fmt"
	"time"
)

func main() {
	_, month, day := time.Now().Date()
	if month == time.November && day == 10 {
		fmt.Println("Happy Go day!")
	}
}