golang convert float to time
package main
import (
"fmt"
"time"
)
func main() {
// Given float value representing seconds
floatSeconds := 3600.0
// Convert float to integer seconds
intSeconds := int(floatSeconds)
// Create time.Duration from integer seconds
duration := time.Second * time.Duration(intSeconds)
// Convert duration to time object
timeValue := time.Time{}.Add(duration)
// Display the time
fmt.Println("Time:", timeValue)
}