I get from input source timestamp and then I make time '00:00:00' for this timestamp. Now I need to get timestamp from object time
timestamp_int:= 1532009163
time := time.Date(
time.Unix(int64(timestamp_int), 0).UTC().Year(),
time.Unix(int64(timestamp_int), 0).UTC().Month(),
time.Unix(int64(timestamp_int), 0).UTC().Day(), 0, 0, 0, 0,
time.Unix(int64(timestamp_int), 0).UTC().Location())
new_time := time.Format("timestamp") //here i need to get new timestamp
You can get the timestamp in seconds by using the Unix
method.
timestamp := 1532009163
t := time.Unix(int64(timestamp), 0)
newTimestamp := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.UTC).Unix()
fmt.Println(newTimestamp)
// 1531958400