How do I add hours, minutes, and seconds (defined as ints) to the current time, similar to AddDate
?
timein := time.Now().Local().AddDate(Hours, Mins, Sec)
but with hours, minutes, and seconds.
How do I add hours, minutes, and seconds (defined as ints) to the current time, similar to AddDate
?
timein := time.Now().Local().AddDate(Hours, Mins, Sec)
but with hours, minutes, and seconds.
I guess what you are looking for is
timein := time.Now().Local().Add(time.Hour * time.Duration(Hours) +
time.Minute * time.Duration(Mins) +
time.Second * time.Duration(Sec))