当前位置:网站首页>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.
输出结果为:
边栏推荐
- What does virtualization mean? What technologies are included? What is the difference with private cloud?
- Click event
- Popupwindow utility class
- 2020 summary: industrial software development under Internet thinking
- 拖放
- Gradient
- 虚拟化是什么意思?包含哪些技术?与私有云有什么区别?
- Kotlin uses viewpager2+fragment+bottomnavigationview to implement the style of the switching module of the bottom menu bar.
- 上传文件/文本/图片,盒子阴影
- ASP. Net startup and running mechanism
猜你喜欢

Uni app custom navigation bar component

Deletelater Usage Summary in QT

Open Camera异常分析(一)

“再谈”协议
![[paper notes] learning to grasp with primitive shaped object policies](/img/59/14d8eef92291cb415a8a1c2e5943e8.png)
[paper notes] learning to grasp with primitive shaped object policies

Graphics card, GPU, CPU, CUDA, video memory, rtx/gtx and viewing mode

MySQL高级篇第一章(linux下安装MySQL)【下】

Drag and drop

进度条

ASP. Net core introduction
随机推荐
用eclipse连mysql数据库出错然后出现图中的话是咋回事呀
2022.6.24-----leetcode.515
Todolist incomplete, completed
TiFlash 函数下推必知必会丨十分钟成为 TiFlash Contributor
JS array array JSON de duplication
WebRTC系列-网络传输之7-ICE补充之偏好(preference)与优先级(priority)
Popupwindow utility class
String到底能不能改变?
Camera-CreateCaptureSession
169. 多数元素
请求对象,发送请求
Is Guoxin golden sun reliable? Is it safe to open a securities account?
Kotlin learning apply plugin: 'kotlin Android extensions‘
Digital twin intelligent water service, breaking through the development dilemma of sponge City
What does virtualization mean? What technologies are included? What is the difference with private cloud?
小米电视的网页和珠宝的网页
Is it safe to open a fund account? How to apply
"Renegotiation" agreement
Classic model alexnet
类图