- GetCurDate

This commit is contained in:
gazebo
2018-11-06 14:37:21 +08:00
parent b30fe17f2a
commit 28f990d7bd

View File

@@ -88,6 +88,12 @@ func GetCurTimeStr() string {
return Time2Str(time.Now())
}
func GetCurDate() time.Time {
now := time.Now()
year, month, day := now.Date()
return time.Date(year, month, day, 0, 0, 0, 0, now.Location())
}
// timestamp is in second
func GetCurTimestamp() int64 {
return time.Now().Unix()