package main
import (
"fmt"
"time"
)
func main() {
now := time.Now()
fmt.Println("Now:", now)
fmt.Println("Year:", now.Year())
month := now.Month()
fmt.Println("Month: ", month)
fmt.Println("Month: ", int(month))
fmt.Println("Day: ", now.Day())
fmt.Println("Hour: ", now.Hour())
fmt.Println("Minutes: ", now.Minute())
fmt.Println("Second: ", now.Second())
}
Output
Now: 2021-11-28 13:37:03.484486 +0700 +07 m=+0.001998901
Year: 2021
Month: November
Month: 11
Day: 28
Hour: 13
Minutes: 37
Second: 3