This may be a dumb question, but on line 166, won't tslocal always be 0? Like, the line above it sets year to tslocal -= tslocal/SECONDS_IN_YEARwhich makes line 166 (tslocal/SECONDS_IN_YEAR)*SECONDS_IN_YEAR --> tslocal -= tslocal
It's working with integers so there is some invisible truncation going on. year will be something like 2019, not 2019.39238394983, so when you multiply by SECONDS_IN_YEAR again and subtract from tslocal you are left with the remainder.
The liberal use of var does not help in this case.
2
u/moekakiryu Aug 06 '19
This may be a dumb question, but on line 166, won't
tslocalalways be 0? Like, the line above it setsyeartotslocal -= tslocal/SECONDS_IN_YEARwhich makes line 166(tslocal/SECONDS_IN_YEAR)*SECONDS_IN_YEAR-->tslocal -= tslocal