package main
import (
"fmt"
"time"
)
func main() {
t := time.Date(2017, 11, 29, 21, 0, 0, 0, time.Local)
fmt.Printf("Extracting units from: %v
", t)
dOfMonth := t.Day()
weekDay := t.Weekday()
month := t.Month()
fmt.Printf("The %dth day of %v is %v
", dOfMonth, month, weekDay)
}
/*
Extracting units from: 2017-11-29 21:00:00 +0800 CST
The 29th day of November is Wednesday
*/