- 获取数值的格式的年月日
package main
import (
"fmt"
"time"
)
func main() {
month := time.Unix(1557042972, 0).Format("1")
fmt.Println(month)
year := time.Now().Format("2006")
month = time.Now().Format("01")
day := time.Now().Format("02")
fmt.Println(year)
fmt.Println(month)
fmt.Println(day)
}