package main
import (
"fmt"
"time"
)
func main() {
now := time.Now().Unix() // ココ
fmt.Println(now)
fmt.Println(time.Unix(now, 0))
}
結果
$ go run main.go
1594910484
2020-07-16 23:41:24 +0900 JST
Go to list of users who liked
More than 3 years have passed since last update.
package main
import (
"fmt"
"time"
)
func main() {
now := time.Now().Unix() // ココ
fmt.Println(now)
fmt.Println(time.Unix(now, 0))
}
結果
$ go run main.go
1594910484
2020-07-16 23:41:24 +0900 JST
Register as a new user and use Qiita more conveniently
Go to list of users who liked