internal NpgsqlDate Add(NpgsqlTimeSpan interval, int carriedOverflow) { switch (_type) { case InternalType.Infinity: return(Infinity); case InternalType.NegativeInfinity: return(NegativeInfinity); case InternalType.Finite: break; default: throw new InvalidOperationException($"Internal Npgsql bug: unexpected value {_type} of enum {nameof(NpgsqlDate)}.{nameof(InternalType)}. Please file a bug."); } return(AddMonths(interval.Months).AddDays(interval.Days + carriedOverflow)); }
public NpgsqlDateTime Subtract(NpgsqlTimeSpan interval) { return(Add(-interval)); }
/// <summary> /// Returns a new <see cref="NpgsqlDateTime"/> that adds the value of the specified TimeSpan to the value of this instance. /// </summary> /// <param name="value">A positive or negative time interval.</param> /// <returns>An object whose value is the sum of the date and time represented by this instance and the time interval represented by value.</returns> public NpgsqlDateTime Add(NpgsqlTimeSpan value) { return(AddTicks(value.Ticks)); }
public NpgsqlDate Subtract(NpgsqlTimeSpan interval) => Add(-interval);