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.
 
 
 

18 lines
424 B

package util
import "time"
// ToDayStart .
func ToDayStart(t time.Time) time.Time {
return time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.Local)
}
// ToDayEnd .
func ToDayEnd(t time.Time) time.Time {
return time.Date(t.Year(), t.Month(), t.Day(), 23, 59, 59, 999, time.Local)
}
// ToDayNoon .
func ToDayNoon(t time.Time) time.Time {
return time.Date(t.Year(), t.Month(), t.Day(), 12, 0, 0, 0, time.Local)
}