Given a year and days elapsed in it , finds date by storing results in d and m .
def revoffsetDays ( offset , y , d , m ) : NEW_LINE INDENT month = [ 0 , 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 ] NEW_LINE if ( isLeap ( y ) ) : NEW_LINE INDENT month [ 2 ] = 29 NEW_LINE DEDENT for i in range ( 1 , 13 ) : NEW_LINE INDENT if ( offset <= month [ i ] ) : NEW_LINE INDENT break NEW_LINE DEDENT offset = offset - month [ i ] NEW_LINE DEDENT d [ 0 ] = offset NEW_LINE m [ 0 ] = i + 1 NEW_LINE DEDENT