Housekeeper/pkg/util/epoch.go
2018-11-15 05:34:24 +00:00

13 lines
308 B
Go

package util
import "time"
// SubtractedEpoch will take the current time in epoch and subtract (days) worth of seconds from the current epoch time.
func SubtractedEpoch(days int) int64 {
now := time.Now()
unix := now.Unix()
seconds := int64(days * 86400)
epoch := int64(unix - seconds)
return epoch
}