Hello everyone in advance, thanks for your answers and comments, my question is simple, I'm learning GO and I don't know how to do this, I want to get the elapsed years from a given date in Golang ie I have the following date saved in a variable:
date := "2020-08-16"
I want to get the years that have elapsed to the current date (2022).
Taking into account that you get the current date with
currentTime := time.Now()
and that a duration is only expressed in hours, minutes and seconds, it would be something likeAnd then parse that to days, months and years, dividing as usual the hours by 24 to obtain days and from there, continue.