Files
mostlymatter/vendor/github.com/splitio/go-split-commons/v3/util/time.go
Joram Wilander aba00a3cfd Update split SDK to 6.0.2 to fix sync bug (#17060)
* Update split SDK to 6.0.2 to fix sync bug

* Vendor and tidy
2021-03-04 11:16:08 -05:00

12 строки
315 B
Go

package util
import "time"
const dedupWindowSizeMs = 3600 * 1000
// TruncateTimeFrame truncates de time frame received with the time window
func TruncateTimeFrame(timestampInNs int64) int64 {
timestampInMs := timestampInNs / int64(time.Millisecond)
return timestampInMs - (timestampInMs % dedupWindowSizeMs)
}