go-utils/date/formater.go
2017-07-11 17:33:03 +08:00

25 lines
278 B
Go

package date
import (
"fmt"
)
const (
YYYYMMDDHHmmSS = "2006-01-02 15:04:05"
)
func Formater(formater string) string {
r := ""
for _, v := range formater {
s := fmt.Sprintf("%c", v)
switch s {
case "y", "Y":
r += s
case "-", " ":
r += s
}
}
return r
}