nextDayMidnight returns the next midnight in the time object's timezone.
(t time.Time)
| 283 | |
| 284 | // nextDayMidnight returns the next midnight in the time object's timezone. |
| 285 | func nextDayMidnight(t time.Time) time.Time { |
| 286 | yy, mm, dd := t.Date() |
| 287 | // time.Date will correctly normalize the date if it's past the end of the |
| 288 | // month. E.g. October 32nd will be November 1st. |
| 289 | dd++ |
| 290 | return time.Date(yy, mm, dd, 0, 0, 0, 0, t.Location()) |
| 291 | } |
| 292 | |
| 293 | // WeeksSinceEpoch gets the weeks since the epoch for a given time. This is a |
| 294 | // 0-indexed number of weeks since the epoch (Monday). |
no test coverage detected