mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
util: add BeginningOfTheDay function
This commit is contained in:
parent
06a1f018c2
commit
c6d66ebb46
|
@ -9,3 +9,9 @@ func MillisecondsJitter(d time.Duration, jitterInMilliseconds int) time.Duration
|
|||
n := rand.Intn(jitterInMilliseconds)
|
||||
return d + time.Duration(n)*time.Millisecond
|
||||
}
|
||||
|
||||
func BeginningOfTheDay(t time.Time) time.Time {
|
||||
year, month, day := t.Date()
|
||||
return time.Date(year, month, day, 0, 0, 0, 0, t.Location())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user