12 lines
234 B
Go
12 lines
234 B
Go
|
package format
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
func TimeToFormat(t time.Time) string {
|
||
|
return time.Time(t).Format("2006-01-02 15:04:05")
|
||
|
}
|
||
|
|
||
|
func TimeIntToFormat(unixTime int64) string {
|
||
|
return time.Unix(unixTime, 0).Format("2006-01-02 15:04:05")
|
||
|
}
|