Skip to content

Instantly share code, notes, and snippets.

@zarazan
Last active February 10, 2023 15:50
Show Gist options
  • Save zarazan/997c4b8eeb68c9c490a631ab024d8798 to your computer and use it in GitHub Desktop.
Save zarazan/997c4b8eeb68c9c490a631ab024d8798 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
)
func main() {
seconds_per_block := float64(6)
current_block_height := int64(5170919)
current_date_time := time.Now()
target_date_time := time.Date(2023, 2, 15, 17, 0, 0, 0, time.UTC)
time_until_upgrade := target_date_time.Sub(current_date_time)
number_of_blocks_in_interval := time_until_upgrade.Seconds() / seconds_per_block
target_block := current_block_height + int64(number_of_blocks_in_interval)
fmt.Printf("Target Block: %d\n", target_block)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment