Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TimeSetter
- def convert(d)
- y = 1980
- while (d > 365) do
- if (y % 400 == 0 ||
- (y % 4 == 0 && y % 100 == 0))
- if (d > 366)
- d -= 366
- y += 1
- end
- else
- d -= 365
- y += 1
- end
- end
- return y
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement