public XsdDuration Normalize() {
int years = Years;
int months = Months;
int days = Days;
int hours = Hours;
int minutes = Minutes;
int seconds = Seconds;
try {
checked {
if (months >= 12) {
years += months / 12;
months %= 12;
}
if (seconds >= 60) {
minutes += seconds / 60;
seconds %= 60;
}
if (minutes >= 60) {
hours += minutes / 60;
minutes %= 60;
}
if (hours >= 24) {
days += hours / 24;
hours %= 24;
}
}
}
catch (OverflowException) {
throw new OverflowException(Res.GetString(Res.XmlConvert_Overflow, ToString(), "Duration"));
}
return new XsdDuration(IsNegative, years, months, days, hours, minutes, seconds, Nanoseconds);
}