如何按此格式打印时间?
23:44:22.184320
我试过的是
func main() { // Which will print to the current time fmt.Println(time.Now()) // How do I convert to // 23:44:22.184320 }
我已经检查了这个链接,但我不知道怎么做 https://gobyexample.com/time-formatting-parsing
谢谢!
改为使用:
time.Now().Format("15:04:05.999999")
请注意 time 包装是:
time
Mon Jan 2 15:04:05 MST 2006
time package