Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int differenceInYears(MyDate comparedDate)
- {
- int retVal = 0;
- int zile_an_curent = (this.month - 1) * 30 + this.day;
- int zile_an_comparat = (compared.month - 1) * 30 + compared.day;
- int suma_zile = (( 365 - zile_an_curent) + zile_an_comparat );
- if ( suma_zile >= 365 )
- {
- retVal = (suma_zile / 365) * math.abs(this.year - compared.year);
- }
- return retVal;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement