Suppose I have
t := time.Parse("15:04:05.000", "12:16:54.016")
This returns a time.Time which prints out as:
0000-01-01 12:16:54.016 +0000 UTC
But I know what the actual date is and have it stored as a variable called timestamp
which is a time.Time struct already. How do I combine them?
e.g. suppose the date is 2019-06-17. I need the output to be:
2019-06-17 12:16:54.016 +0000 UTC
// this doesn't compile
ts.AddDate(timestamp.Year(), timestamp.Month(), timestamp.Day())
cannot use timestamp.Month() (type time.Month) as type int in argument to ts.AddDate
This should be trivial right? well it is in C which is what I'm most used to. But I haven't found the answer easily for golang. The docs don't tell me the actual underlying field names, just functions. :-/