github.com/gogf/gf@v1.16.9/.example/os/gtime/gtime_format.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/gogf/gf/os/gtime"
     7  )
     8  
     9  func main() {
    10  	formats := []string{
    11  		"Y-m-d H:i:s.u",
    12  		"D M d H:i:s T O Y",
    13  		"\\T\\i\\m\\e \\i\\s: h:i:s a",
    14  		"2006-01-02T15:04:05.000000000Z07:00",
    15  	}
    16  	t := gtime.Now()
    17  	for _, f := range formats {
    18  		fmt.Println(t.Format(f))
    19  	}
    20  }