public IntervalSecondData(long seconds, int nanos, IntervalType type) { if (seconds >= type.GetIntervalValueLimit()) { throw Error.GetError(0xd6b); } this.Units = seconds; this.Nanos = nanos; }
public IntervalMonthData(long months, IntervalType type) { if (months >= type.GetIntervalValueLimit()) { throw Error.GetError(0xd4e); } if (type.TypeCode == 0x65) { months -= months % 12L; } this.Units = months; }
public IntervalSecondData(long seconds, long nanos, IntervalType type, bool normalise) { if (nanos >= 0x3b9aca00L) { long num2 = nanos / 0x3b9aca00L; nanos = nanos % 0x3b9aca00L; seconds += num2; } else if (nanos <= -1000000000L) { long num3 = -nanos / 0x3b9aca00L; nanos = -(-nanos % 0x3b9aca00L); seconds -= num3; } int num = DTIType.NanoScaleFactors[type.Scale]; nanos /= (long)num; nanos *= num; if ((seconds > 0L) && (nanos < 0L)) { nanos += 0x3b9aca00L; seconds -= 1L; } else if ((seconds < 0L) && (nanos > 0L)) { nanos -= 0x3b9aca00L; seconds += 1L; } num = DTIType.YearToSecondFactors[type.EndPartIndex]; seconds /= (long)num; seconds *= num; if (seconds >= type.GetIntervalValueLimit()) { throw Error.GetError(0xd6b); } this.Units = seconds; this.Nanos = (int)nanos; }