You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
474 B
27 lines
474 B
6 months ago
|
package utils
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
DateTimeFormat string = "2006-01-02 15:04:05"
|
||
|
DateTimeFormat1 string = "2006-01-02T15:04:05Z07:00"
|
||
|
DateTimeFormat2 string = "2006-01-02 15:04"
|
||
|
DateFormat string = "2006-01-02"
|
||
|
Timestamp string = "20060102150405"
|
||
|
)
|
||
|
|
||
|
func GetNow() time.Time {
|
||
|
return time.Now()
|
||
|
}
|
||
|
|
||
|
func GetUTC() time.Time {
|
||
|
return time.Now().UTC()
|
||
|
}
|
||
|
|
||
|
func GetCurrentTimeStr() string {
|
||
|
return fmt.Sprintf("%v", time.Now().UnixNano()/1000)
|
||
|
}
|