Skip to content

Instantly share code, notes, and snippets.

@pedrokoblitz
Created July 6, 2016 16:03
Show Gist options
  • Save pedrokoblitz/790d72c710b043e6d27eb15cacb0877c to your computer and use it in GitHub Desktop.
Save pedrokoblitz/790d72c710b043e6d27eb15cacb0877c to your computer and use it in GitHub Desktop.
func TodayDate() time.Time {
sp, err := time.LoadLocation("America/Sao_Paulo")
if err != nil {
panic(err)
}
now := time.Now().In(sp)
year, month, day := now.Date()
return time.Date(year, month, day, 0, 0, 0, 0, now.Location())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment