-3
我試圖用圍棋的語言來獲得毫秒當前時間https://golang.org/#如何使用Go語言以毫秒爲單位獲取當前時間?
package main
import "fmt"
import "time"
func main() {
now := time.Now()
secs := now.Unix()
nanos := now.UnixNano()
fmt.Println(now)
millis := nanos/1000000
fmt.Println(millis)
}
當我使用上述網站運行上面的代碼輸出我得到的是以下幾點:
2009-11-10 23:00:00 +0000 UTC
1257894000000
我不是能夠理解爲什麼我沒有得到當前日期的結果?我試着在其他網站上https://www.epochconverter.com/相同的代碼,並得到這是繼正確的結果:
Time Now is :
1496230018
有人可以確認該問題是否與我的代碼或者是一下顯示錯誤結果的網站?
謝謝
答案在https://stackoverflow.com/questions/24122821/go-golang-time-now-unixnano-convert-to-milliseconds。 – Petrillo