I was needed to parse time.Duration in format like HH:MM:SS
It’s very handy to parse it with time.Parse("15:04:05", stringToParse), but then I need to get duration. There is another handy method for this time.Sub.
The zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC. As this time is unlikely to come up in practice, the IsZero method gives a simple way of detecting a time that has not been initialized explicitly.
The zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC. As this time is unlikely to come up in practice, the IsZero method gives a simple way of detecting a time that has not been initialized explicitly.
If the year is not applicable, as in your case, zero is the obvious value for year. The zero value for time.Time is an unlikely value.