Situation:
When I call time functions like Second()
, Year()
etc., I get a result of tye int
. But when I call Month()
, I get a result of type Month
.
I found the following in the online docs:
type Month int
...
func (m Month) String() string
.. but I don't quite understand it.
Problem:
My code has the following error because m
is not an int
:
invalid operation:
m / time.Month(10) + offset
(mismatched types time.Month and int)
Question:
How to get an int
from Month()
?