当前位置:网站首页>go time包:秒、毫秒、纳秒时间戳输出
go time包:秒、毫秒、纳秒时间戳输出
2022-06-26 03:35:00 【51CTO】
时间戳
10 位数的是以 秒 为单位;
13 位数的是以 毫秒 为单位;
19 位数的是以 纳秒 为单位;
golang 中可以这样写:
package main
import (
"fmt"
"time"
)
func main() {
fmt.Printf("时间戳(秒):%v\n", time.Now().Unix())
fmt.Printf("时间戳(纳秒):%v\n", time.Now().UnixNano())
fmt.Printf("时间戳(毫秒):%v\n", time.Now().UnixNano()/1e6)
fmt.Printf("时间戳(纳秒转换为秒):%v\n", time.Now().UnixNano()/1e9)
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
输出结果为:
边栏推荐
- Solve the problem that the input box is blocked by the pop-up keyboard under the WebView transparent status bar
- Classic model alexnet
- MySQL advanced Chapter 1 (installing MySQL under Linux) [2]
- [paper notes] learning to grasp with primitive shaped object policies
- 多媒体元素,音频、视频
- What does virtualization mean? What technologies are included? What is the difference with private cloud?
- Upload file / text / picture, box shadow
- Uni app Baidu cloud realizes OCR ID card recognition
- usb peripheral 驱动 - 枚举
- 2022.6.24-----leetcode.515
猜你喜欢
随机推荐
ABP framework Practice Series (III) - domain layer in depth
todolist未完成,已完成
Non H5 end of uni app, regional setting of status bar on the top of mobile phone
Evaluation - analytic hierarchy process
When the tiflash function is pushed down, it must be known that it will become a tiflash contributor in ten minutes
力扣79单词搜索
ASP. Net startup and running mechanism
progress bar
QPS的概念和实现
Communication mode between processes
USB peripheral driver - Enumeration
Solve the problem that the input box is blocked by the pop-up keyboard under the WebView transparent status bar
进度条
Procédures stockées MySQL
Andorid hide the title bar of the system
Kotlin learning apply plugin: 'kotlin Android extensions‘
请求对象,发送请求
MapReduce执行原理记录
JS array array JSON de duplication
Graphics card, GPU, CPU, CUDA, video memory, rtx/gtx and viewing mode







