2024-04-11 12:45:01 +00:00
|
|
|
package data_updater
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func calculateTime() int64 {
|
|
|
|
now := time.Now()
|
|
|
|
|
|
|
|
targetTime := time.Date(now.Year(), now.Month(), now.Day(), 4, 0, 0, 0, now.Location())
|
|
|
|
if now.After(targetTime) {
|
|
|
|
targetTime = targetTime.AddDate(0, 0, 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
toTarget := targetTime.Sub(now)
|
2024-05-20 09:36:04 +00:00
|
|
|
sec := toTarget.Nanoseconds()
|
2024-04-11 12:45:01 +00:00
|
|
|
|
|
|
|
return sec
|
|
|
|
}
|