In Go, how do I get the Unix epoch in seconds for a date without time?
For example, if I want the Unix epoch seconds for the current time, I can use:
today := time.Now().Unix()
For instance, if the current date+time is 2021-12-31 11:56:01, I want to get the Unix epoch in seconds for 2021-12-31 00:00:00. Is there an easy way to do this, or do I have to convert to a string, manipulate the string, then parse the string?
Copyright Notice:Content Author:「Shafique Jamal」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/70543309/how-do-i-get-the-unix-epoch-in-seconds-for-a-date-without-time