gf/.example/os/gtime/gtime_layout.go

21 lines
317 B
Go
Raw Normal View History

package main
import (
2019-04-03 00:03:46 +08:00
"fmt"
2019-07-29 21:01:19 +08:00
"github.com/gogf/gf/os/gtime"
)
func main() {
2019-04-03 00:03:46 +08:00
formats := []string{
"2006-01-02 15:04:05.000",
"Mon Jan _2 15:04:05 MST 2006",
"Time is: 03:04:05 PM",
"2006-01-02T15:04:05.000000000Z07:00 MST",
}
t := gtime.Now()
for _, f := range formats {
fmt.Println(t.Layout(f))
}
}