nowTime := time.Now()
year := time.Now().Year()
month := time.Now().Month()
day := time.Now().Day()
hour := time.Now().Hour()
minute := time.Now().Minute()
second := time.Now().Second()
nanosecond := time.Now().Nanosecond()
// 10 位时间戳(秒)
timestamp := time.Now().Unix()
// 19 位时间戳(纳秒)
timestampNano := time.Now().UnixNano()
// 13 位时间戳(毫秒)
timestampMillisecond := timestampNano / 1e6
fmt.Printf("时间戳(秒):%v\n", timestamp)
fmt.Printf("时间戳(纳秒):%v\n", timestampNano)
fmt.Printf("时间戳(毫秒):%v\n", timestampMillisecond)
fmt.Printf("时间戳(纳秒转换为秒):%v\n", timestampNano/1e9)