github.com/gogf/gf@v1.16.9/.example/os/gtime/gtime_json.go (about) 1 package main 2 3 import ( 4 "encoding/json" 5 "fmt" 6 7 "github.com/gogf/gf/os/gtime" 8 ) 9 10 func main() { 11 t := gtime.Now() 12 b, err := json.Marshal(t) 13 fmt.Println(err) 14 fmt.Println(string(b)) 15 }