Calculating current year
while ( daysTillNow >= 365 ) : NEW_LINE INDENT if ( currYear % 400 == 0 or ( currYear % 4 == 0 and currYear % 100 != 0 ) ) : NEW_LINE INDENT daysTillNow -= 366 NEW_LINE DEDENT else : NEW_LINE INDENT daysTillNow -= 365 NEW_LINE DEDENT currYear += 1 NEW_LINE DEDENT