mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 11:11:20 +00:00
16 lines
385 B
Go
16 lines
385 B
Go
|
package slotutil
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"github.com/prysmaticlabs/prysm/shared/params"
|
||
|
)
|
||
|
|
||
|
// SlotStartTime returns the start time in terms of its unix epoch
|
||
|
// value.
|
||
|
func SlotStartTime(genesis uint64, slot uint64) time.Time {
|
||
|
duration := time.Second * time.Duration(slot*params.BeaconConfig().SecondsPerSlot)
|
||
|
startTime := time.Unix(int64(genesis), 0).Add(duration)
|
||
|
return startTime
|
||
|
}
|