Struct NpgsqlInterval
- Namespace
- NpgsqlTypes
- Assembly
- Npgsql.dll
A raw representation of the PostgreSQL interval datatype. Use only when TimeSpan or NodaTime Period do not have sufficient range to handle your values.
public readonly struct NpgsqlInterval : IEquatable<NpgsqlInterval>
- Implements
- Inherited Members
Remarks
See https://www.postgresql.org/docs/current/static/datatype-geometric.html.
Do not use this type unless you have to: prefer TimeSpan or NodaTime Period when possible.
Constructors
NpgsqlInterval(int, int, long)
Constructs an NpgsqlInterval.
public NpgsqlInterval(int months, int days, long time)
Parameters
Properties
Days
Days, after time for alignment.
public int Days { get; }
Property Value
Months
Months and years, after time for alignment.
public int Months { get; }
Property Value
Time
Remaining time unit smaller than a day, in microseconds.
public long Time { get; }
Property Value
Methods
Equals(NpgsqlInterval)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(NpgsqlInterval other)
Parameters
other
NpgsqlIntervalAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.