Table of Contents

Struct NpgsqlTimeSpan

Namespace
NpgsqlTypes
Assembly
Npgsql.dll

Represents the PostgreSQL interval datatype.

public readonly struct NpgsqlTimeSpan : IComparable, IComparer, IEquatable<NpgsqlTimeSpan>, IComparable<NpgsqlTimeSpan>, IComparer<NpgsqlTimeSpan>
Implements
Inherited Members

Remarks

PostgreSQL differs from .NET in how it's interval type doesn't assume 24 hours in a day (to deal with 23- and 25-hour days caused by daylight savings adjustments) and has a concept of months that doesn't exist in .NET's TimeSpan class. (Neither datatype has any concessions for leap-seconds).

For most uses just casting to and from TimeSpan will work correctly — in particular, the results of subtracting one DateTime or the PostgreSQL date, time and timestamp types from another should be the same whether you do so in .NET or PostgreSQL — but if the handling of days and months in PostgreSQL is important to your application then you should use this class instead of TimeSpan.

If you don't know whether these differences are important to your application, they probably arent! Just use TimeSpan and do not use this class directly ☺

To avoid forcing unnecessary provider-specific concerns on users who need not be concerned with them a call to GetValue(int) on a field containing an NpgsqlTimeSpan value will return a TimeSpan rather than an NpgsqlTimeSpan. If you need the extra functionality of NpgsqlTimeSpan then use GetInterval(int).

Constructors

NpgsqlTimeSpan(int, int, int, int)

Initializes a new NpgsqlTimeSpan to the specified number of days, hours, minutes & seconds.

public NpgsqlTimeSpan(int days, int hours, int minutes, int seconds)

Parameters

days int

Number of days.

hours int

Number of hours.

minutes int

Number of minutes.

seconds int

Number of seconds.

NpgsqlTimeSpan(int, int, int, int, int)

Initializes a new NpgsqlTimeSpan to the specified number of days, hours, minutes, seconds & milliseconds.

public NpgsqlTimeSpan(int days, int hours, int minutes, int seconds, int milliseconds)

Parameters

days int

Number of days.

hours int

Number of hours.

minutes int

Number of minutes.

seconds int

Number of seconds.

milliseconds int

Number of milliseconds.

NpgsqlTimeSpan(int, int, int, int, int, int)

Initializes a new NpgsqlTimeSpan to the specified number of months, days, hours, minutes, seconds & milliseconds.

public NpgsqlTimeSpan(int months, int days, int hours, int minutes, int seconds, int milliseconds)

Parameters

months int

Number of months.

days int

Number of days.

hours int

Number of hours.

minutes int

Number of minutes.

seconds int

Number of seconds.

milliseconds int

Number of milliseconds.

NpgsqlTimeSpan(int, int, int, int, int, int, int)

Initializes a new NpgsqlTimeSpan to the specified number of years, months, days, hours, minutes, seconds & milliseconds.

Years are calculated exactly equivalent to 12 months.

public NpgsqlTimeSpan(int years, int months, int days, int hours, int minutes, int seconds, int milliseconds)

Parameters

years int

Number of years.

months int

Number of months.

days int

Number of days.

hours int

Number of hours.

minutes int

Number of minutes.

seconds int

Number of seconds.

milliseconds int

Number of milliseconds.

NpgsqlTimeSpan(int, int, long)

Initializes a new NpgsqlTimeSpan to the specified number of months, days & ticks.

public NpgsqlTimeSpan(int months, int days, long ticks)

Parameters

months int

Number of months.

days int

Number of days.

ticks long

Number of 100ns units.

NpgsqlTimeSpan(long)

Initializes a new NpgsqlTimeSpan to the specified number of ticks.

public NpgsqlTimeSpan(long ticks)

Parameters

ticks long

A time period expressed in 100ns units.

NpgsqlTimeSpan(TimeSpan)

Initializes a new NpgsqlTimeSpan to hold the same time as a TimeSpan

public NpgsqlTimeSpan(TimeSpan timespan)

Parameters

timespan TimeSpan

A time period expressed in a TimeSpan

Fields

DaysPerMonth

Represents the number of days assumed in one month if month justification or unjustifcation is performed. This is set to 30 for consistency with PostgreSQL. Note that this is means that month adjustments cause a year to be taken as 30 × 12 = 360 rather than 356/366 days.

public const int DaysPerMonth = 30

Field Value

int

HoursPerDay

Represents the number of hours in one day (assuming no daylight savings adjustments). This field is constant.

public const int HoursPerDay = 24

Field Value

int

MaxValue

Represents the maximum NpgsqlTimeSpan. This field is read-only.

public static readonly NpgsqlTimeSpan MaxValue

Field Value

NpgsqlTimeSpan

MinValue

Represents the minimum NpgsqlTimeSpan. This field is read-only.

public static readonly NpgsqlTimeSpan MinValue

Field Value

NpgsqlTimeSpan

MonthsPerYear

Represents the number of months in a year. This field is constant.

public const int MonthsPerYear = 12

Field Value

int

TicksPerDay

Represents the number of ticks (100ns periods) in one day. This field is constant.

public const long TicksPerDay = 864000000000

Field Value

long

TicksPerHour

Represents the number of ticks (100ns periods) in one hour. This field is constant.

public const long TicksPerHour = 36000000000

Field Value

long

TicksPerMicrosecond

Represents the number of ticks (100ns periods) in one microsecond. This field is constant.

public const long TicksPerMicrosecond = 10

Field Value

long

TicksPerMillsecond

Represents the number of ticks (100ns periods) in one millisecond. This field is constant.

public const long TicksPerMillsecond = 10000

Field Value

long

TicksPerMinute

Represents the number of ticks (100ns periods) in one minute. This field is constant.

public const long TicksPerMinute = 600000000

Field Value

long

TicksPerMonth

Represents the number of ticks (100ns periods) in one day, assuming 30 days per month. DaysPerMonth

public const long TicksPerMonth = 25920000000000

Field Value

long

TicksPerSecond

Represents the number of ticks (100ns periods) in one second. This field is constant.

public const long TicksPerSecond = 10000000

Field Value

long

Zero

Represents the zero NpgsqlTimeSpan. This field is read-only.

public static readonly NpgsqlTimeSpan Zero

Field Value

NpgsqlTimeSpan

Properties

Days

Gets the number of days held in the instance. Note that this does not pay attention to a time component with -24 or less hours or 24 or more hours, unless JustifyDays() has been called to produce this instance.

public int Days { get; }

Property Value

int

Hours

Gets the number of whole hours held in the instance. Note that this can be less than -23 or greater than 23 unless JustifyDays() has been used to produce this instance.

public int Hours { get; }

Property Value

int

Microseconds

Gets the number of whole microseconds held in the instance. An in the range [-999999, 999999].

public int Microseconds { get; }

Property Value

int

Milliseconds

Gets the number of whole milliseconds held in the instance. An in the range [-999, 999].

public int Milliseconds { get; }

Property Value

int

Minutes

Gets the number of whole minutes held in the instance. An in the range [-59, 59].

public int Minutes { get; }

Property Value

int

Months

Gets the number of months held in the instance. Note that this does not pay attention to a day component with -30 or less days or 30 or more days, unless JustifyMonths() has been called to produce this instance.

public int Months { get; }

Property Value

int

Seconds

Gets the number of whole seconds held in the instance. An in the range [-59, 59].

public int Seconds { get; }

Property Value

int

Ticks

The total number of ticks(100ns units) contained. This is the resolution of the NpgsqlTimeSpan type. This ignores the number of days and months held. If you want them included use UnjustifyInterval() first. The resolution of the PostgreSQL interval type is by default 1µs = 1,000 ns. It may be smaller as follows:

  1. interval(0)resolution of 1s (1 second)
  2. interval(1)resolution of 100ms = 0.1s (100 milliseconds)
  3. interval(2)resolution of 10ms = 0.01s (10 milliseconds)
  4. interval(3)resolution of 1ms = 0.001s (1 millisecond)
  5. interval(4)resolution of 100µs = 0.0001s (100 microseconds)
  6. interval(5)resolution of 10µs = 0.00001s (10 microseconds)
  7. interval(6) or intervalresolution of 1µs = 0.000001s (1 microsecond)

As such, if the 100-nanosecond resolution is significant to an application, a PostgreSQL interval will not suffice for those purposes.

In more frequent cases though, the resolution of the interval suffices. NpgsqlTimeSpan will always suffice to handle the resolution of any interval value, and upon writing to the database, will be rounded to the resolution used.

The number of ticks in the instance.
public long Ticks { get; }

Property Value

long

Time

Returns a TimeSpan representing the time component of the instance. Note that this may have a value beyond the range ±23:59:59.9999999 unless JustifyDays() has been called to produce this instance.

public TimeSpan Time { get; }

Property Value

TimeSpan

TotalDays

The total number of days in the instance, assuming 24 hours in each day and 30 days in a month.

public double TotalDays { get; }

Property Value

double

TotalHours

The total number of hours in the instance, assuming 24 hours in each day and 30 days in a month.

public double TotalHours { get; }

Property Value

double

TotalMicroseconds

The total number of microseconds in the instance, assuming 24 hours in each day and 30 days in a month.

public double TotalMicroseconds { get; }

Property Value

double

TotalMilliseconds

The total number of milliseconds in the instance, assuming 24 hours in each day and 30 days in a month.

public double TotalMilliseconds { get; }

Property Value

double

TotalMinutes

The total number of minutes in the instance, assuming 24 hours in each day and 30 days in a month.

public double TotalMinutes { get; }

Property Value

double

TotalMonths

The total number of months in the instance, assuming 24 hours in each day and 30 days in a month.

public double TotalMonths { get; }

Property Value

double

TotalSeconds

The total number of seconds in the instance, assuming 24 hours in each day and 30 days in a month.

public double TotalSeconds { get; }

Property Value

double

TotalTicks

The total number of ticks (100ns units) in the instance, assuming 24 hours in each day and 30 days in a month.

public long TotalTicks { get; }

Property Value

long

Methods

Add(NpgsqlTimeSpan)

Adds another interval to this instance and returns the result.

public NpgsqlTimeSpan Add(NpgsqlTimeSpan interval)

Parameters

interval NpgsqlTimeSpan

An NpgsqlTimeSpan to add to this instance.

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan whose values are the sums of the two instances.

Canonicalize()

Produces a canonical NpgslInterval with 0 months and hours in the range of [-23, 23].

While the fact that for many purposes, two different NpgsqlTimeSpan instances could be considered equivalent (e.g. one with 2days, 3hours and one with 1day 27hours) there are different possible canonical forms.

E.g. we could move all excess hours into days and all excess days into months and have the most readable form, or we could move everything into the ticks and have the form that allows for the easiest arithmetic) the form chosen has two important properties that make it the best choice.

First, it is closest two how TimeSpan objects are most often represented. Second, it is compatible with results of many PostgreSQL functions, particularly with age() and the results of subtracting one date, time or timestamp from another.

Note that the results of casting a TimeSpan to NpgsqlTimeSpan is canonicalised.

public NpgsqlTimeSpan Canonicalize()

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan based on this one, but with months converted to multiples of ±30days and with any hours outside of the range [-23, 23] converted into days.

Compare(NpgsqlTimeSpan, NpgsqlTimeSpan)

Compares two NpgsqlTimeSpan instances.

public static int Compare(NpgsqlTimeSpan x, NpgsqlTimeSpan y)

Parameters

x NpgsqlTimeSpan

The first NpgsqlTimeSpan.

y NpgsqlTimeSpan

The second NpgsqlTimeSpan.

Returns

int

0 if the two are equal or equivalent. A value greater than zero if x is greater than y, a value less than zero if x is less than y.

CompareTo(NpgsqlTimeSpan)

Compares this instance with another/

public int CompareTo(NpgsqlTimeSpan other)

Parameters

other NpgsqlTimeSpan

An NpgsqlTimeSpan to compare this with.

Returns

int

0 if the instances are equal or equivalent. A value less than zero if this instance is less than the argument. A value greater than zero if this instance is greater than the instance.

CompareTo(object)

Compares this instance with another/

public int CompareTo(object other)

Parameters

other object

An object to compare this with.

Returns

int

0 if the argument is an NpgsqlTimeSpan and the instances are equal or equivalent. A value less than zero if the argument is an NpgsqlTimeSpan and this instance is less than the argument. A value greater than zero if the argument is an NpgsqlTimeSpan and this instance is greater than the instance.

Exceptions

ArgumentException

The argument is not an NpgsqlTimeSpan.

Duration()

This absolute value of this instance. In the case of some, but not all, components being negative, the rules used for justification are used to determine if the instance is positive or negative.

public NpgsqlTimeSpan Duration()

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan whose value is the absolute value of this instance.

Equals(NpgsqlTimeSpan)

Returns true if another NpgsqlTimeSpan is exactly the same as this instance.

public bool Equals(NpgsqlTimeSpan other)

Parameters

other NpgsqlTimeSpan

An NpgsqlTimeSpan for comparison.

Returns

bool

true if the two NpgsqlTimeSpan instances are exactly the same, false otherwise.

Equals(object)

Returns true if another object is an NpgsqlTimeSpan, that is exactly the same as this instance

public override bool Equals(object obj)

Parameters

obj object

An object for comparison.

Returns

bool

true if the argument is an NpgsqlTimeSpan and is exactly the same as this one, false otherwise.

FromDays(double)

Creates an NpgsqlTimeSpan from a number of days.

public static NpgsqlTimeSpan FromDays(double days)

Parameters

days double

The number of days in the interval.

Returns

NpgsqlTimeSpan

A Canonicalize()d NpgsqlTimeSpan with the given number of days.

FromHours(double)

Creates an NpgsqlTimeSpan from a number of hours.

public static NpgsqlTimeSpan FromHours(double hours)

Parameters

hours double

The number of hours in the interval.

Returns

NpgsqlTimeSpan

A Canonicalize()d NpgsqlTimeSpan with the given number of hours.

FromMicroseconds(double)

Creates an NpgsqlTimeSpan from a number of microseconds.

public static NpgsqlTimeSpan FromMicroseconds(double micro)

Parameters

micro double

The number of microseconds in the interval.

Returns

NpgsqlTimeSpan

A Canonicalize()d NpgsqlTimeSpan with the given number of microseconds.

FromMilliseconds(double)

Creates an NpgsqlTimeSpan from a number of milliseconds.

public static NpgsqlTimeSpan FromMilliseconds(double milli)

Parameters

milli double

The number of milliseconds in the interval.

Returns

NpgsqlTimeSpan

A Canonicalize()d NpgsqlTimeSpan with the given number of milliseconds.

FromMinutes(double)

Creates an NpgsqlTimeSpan from a number of minutes.

public static NpgsqlTimeSpan FromMinutes(double minutes)

Parameters

minutes double

The number of minutes in the interval.

Returns

NpgsqlTimeSpan

A Canonicalize()d NpgsqlTimeSpan with the given number of minutes.

FromMonths(double)

Creates an NpgsqlTimeSpan from a number of months.

public static NpgsqlTimeSpan FromMonths(double months)

Parameters

months double

The number of months in the interval.

Returns

NpgsqlTimeSpan

A Canonicalize()d NpgsqlTimeSpan with the given number of months.

FromSeconds(double)

Creates an NpgsqlTimeSpan from a number of seconds.

public static NpgsqlTimeSpan FromSeconds(double seconds)

Parameters

seconds double

The number of seconds in the interval.

Returns

NpgsqlTimeSpan

A Canonicalize()d NpgsqlTimeSpan with the given number of seconds.

FromTicks(long)

Creates an NpgsqlTimeSpan from a number of ticks.

public static NpgsqlTimeSpan FromTicks(long ticks)

Parameters

ticks long

The number of ticks (100ns units) in the interval.

Returns

NpgsqlTimeSpan

A Canonicalize()d NpgsqlTimeSpan with the given number of ticks.

GetHashCode()

A hash code suitable for uses with hashing algorithms.

public override int GetHashCode()

Returns

int

An signed integer.

JustifyDays()

Equivalent to PostgreSQL's justify_days function.

public NpgsqlTimeSpan JustifyDays()

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan based on this one, but with any hours outside of the range [-23, 23] converted into days.

JustifyInterval()

Equivalent to PostgreSQL's justify_interval function.

public NpgsqlTimeSpan JustifyInterval()

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan based on this one, but with any months converted to multiples of ±30days and then with any days converted to multiples of ±24hours

JustifyMonths()

Equivalent to PostgreSQL's justify_months function.

public NpgsqlTimeSpan JustifyMonths()

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan based on this one, but with any days outside of the range [-30, 30] converted into months.

Negate()

Returns an NpgsqlTimeSpan whose value is the negated value of this instance.

public NpgsqlTimeSpan Negate()

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan whose value is the negated value of this instance.

Parse(string)

Parses a string and returns a NpgsqlTimeSpan instance. Designed to use the formats generally returned by PostgreSQL.

public static NpgsqlTimeSpan Parse(string str)

Parameters

str string

The string to parse.

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan represented by the argument.

Exceptions

ArgumentNullException

The string was null.

OverflowException

A value obtained from parsing the string exceeded the values allowed for the relevant component.

FormatException

The string was not in a format that could be parsed to produce an NpgsqlTimeSpan.

Plus(NpgsqlTimeSpan)

Returns the instance.

public static NpgsqlTimeSpan Plus(NpgsqlTimeSpan x)

Parameters

x NpgsqlTimeSpan

Returns

NpgsqlTimeSpan

Subtract(NpgsqlTimeSpan)

Subtracts another interval from this instance and returns the result.

public NpgsqlTimeSpan Subtract(NpgsqlTimeSpan interval)

Parameters

interval NpgsqlTimeSpan

An NpgsqlTimeSpan to subtract from this instance.

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan whose values are the differences of the two instances.

ToNpgsqlTimeSpan(TimeSpan)

Casts a TimeSpan to an NpgsqlTimeSpan.

public static NpgsqlTimeSpan ToNpgsqlTimeSpan(TimeSpan timespan)

Parameters

timespan TimeSpan

Returns

NpgsqlTimeSpan

ToString()

Create a string representation of the NpgsqlTimeSpan instance. The format returned is of the form: [M mon[s]] [d day[s]] [HH:mm:ss[.f[f[f[f[f[f[f[f[f]]]]]]]]]] A zero NpgsqlTimeSpan is represented as 00:00:00 Ticks are 100ns, Postgress resolution is only to 1µs at most. Hence we lose 1 or more decimal precision in storing values in the database. Despite this, this method will output that extra digit of precision. It's forward-compatible with any future increases in resolution up to 100ns, and also makes this ToString() more applicable to any other use-case.

public override string ToString()

Returns

string

The string representation.

ToTimeSpan(NpgsqlTimeSpan)

Casts an NpgsqlTimeSpan to a TimeSpan.

public static TimeSpan ToTimeSpan(NpgsqlTimeSpan interval)

Parameters

interval NpgsqlTimeSpan

Returns

TimeSpan

TryParse(string, out NpgsqlTimeSpan)

Attempt to parse a string to produce an NpgsqlTimeSpan.

public static bool TryParse(string str, out NpgsqlTimeSpan result)

Parameters

str string

The string to parse.

result NpgsqlTimeSpan

(out) The NpgsqlTimeSpan produced, or Zero if the parsing failed.

Returns

bool

true if the parsing succeeded, false otherwise.

UnjustifyDays()

Opposite to PostgreSQL's justify_days function.

public NpgsqlTimeSpan UnjustifyDays()

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan based on this one, but with any days converted to multiples of ±24hours.

UnjustifyInterval()

Opposite to PostgreSQL's justify_interval function.

public NpgsqlTimeSpan UnjustifyInterval()

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan based on this one, but with any months converted to multiples of ±30days and then any days converted to multiples of ±24hours;

UnjustifyMonths()

Opposite to PostgreSQL's justify_months function.

public NpgsqlTimeSpan UnjustifyMonths()

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan based on this one, but with any months converted to multiples of ±30days.

Operators

operator +(NpgsqlTimeSpan, NpgsqlTimeSpan)

Adds two NpgsqlTimeSpan together.

public static NpgsqlTimeSpan operator +(NpgsqlTimeSpan x, NpgsqlTimeSpan y)

Parameters

x NpgsqlTimeSpan

The first NpgsqlTimeSpan to add.

y NpgsqlTimeSpan

The second NpgsqlTimeSpan to add.

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan whose values are the sum of the arguments.

operator ==(NpgsqlTimeSpan, NpgsqlTimeSpan)

Returns true if two NpgsqlTimeSpan are exactly the same.

public static bool operator ==(NpgsqlTimeSpan x, NpgsqlTimeSpan y)

Parameters

x NpgsqlTimeSpan

The first NpgsqlTimeSpan to compare.

y NpgsqlTimeSpan

The second NpgsqlTimeSpan to compare.

Returns

bool

true if the two arguments are exactly the same, false otherwise.

explicit operator TimeSpan(NpgsqlTimeSpan)

Explicit cast of an NpgsqlTimeSpan to a TimeSpan.

public static explicit operator TimeSpan(NpgsqlTimeSpan interval)

Parameters

interval NpgsqlTimeSpan

A NpgsqlTimeSpan.

Returns

TimeSpan

An equivalent TimeSpan.

operator >(NpgsqlTimeSpan, NpgsqlTimeSpan)

Compares two NpgsqlTimeSpan instances to see if the first is greater than the second

public static bool operator >(NpgsqlTimeSpan x, NpgsqlTimeSpan y)

Parameters

x NpgsqlTimeSpan

The first NpgsqlTimeSpan to compare.

y NpgsqlTimeSpan

The second NpgsqlTimeSpan to compare.

Returns

bool

true if the first NpgsqlTimeSpan is greater than second, false otherwise.

operator >=(NpgsqlTimeSpan, NpgsqlTimeSpan)

Compares two NpgsqlTimeSpan instances to see if the first is greater than or equivalent the second

public static bool operator >=(NpgsqlTimeSpan x, NpgsqlTimeSpan y)

Parameters

x NpgsqlTimeSpan

The first NpgsqlTimeSpan to compare.

y NpgsqlTimeSpan

The second NpgsqlTimeSpan to compare.

Returns

bool

true if the first NpgsqlTimeSpan is greater than or equivalent to the second, false otherwise.

implicit operator NpgsqlTimeSpan(TimeSpan)

Implicit cast of a TimeSpan to an NpgsqlTimeSpan

public static implicit operator NpgsqlTimeSpan(TimeSpan timespan)

Parameters

timespan TimeSpan

A TimeSpan

Returns

NpgsqlTimeSpan

An eqivalent, canonical, NpgsqlTimeSpan.

operator !=(NpgsqlTimeSpan, NpgsqlTimeSpan)

Returns false if two NpgsqlTimeSpan are exactly the same.

public static bool operator !=(NpgsqlTimeSpan x, NpgsqlTimeSpan y)

Parameters

x NpgsqlTimeSpan

The first NpgsqlTimeSpan to compare.

y NpgsqlTimeSpan

The second NpgsqlTimeSpan to compare.

Returns

bool

false if the two arguments are exactly the same, true otherwise.

operator <(NpgsqlTimeSpan, NpgsqlTimeSpan)

Compares two NpgsqlTimeSpan instances to see if the first is less than the second

public static bool operator <(NpgsqlTimeSpan x, NpgsqlTimeSpan y)

Parameters

x NpgsqlTimeSpan

The first NpgsqlTimeSpan to compare.

y NpgsqlTimeSpan

The second NpgsqlTimeSpan to compare.

Returns

bool

true if the first NpgsqlTimeSpan is less than second, false otherwise.

operator <=(NpgsqlTimeSpan, NpgsqlTimeSpan)

Compares two NpgsqlTimeSpan instances to see if the first is less than or equivalent to the second

public static bool operator <=(NpgsqlTimeSpan x, NpgsqlTimeSpan y)

Parameters

x NpgsqlTimeSpan

The first NpgsqlTimeSpan to compare.

y NpgsqlTimeSpan

The second NpgsqlTimeSpan to compare.

Returns

bool

true if the first NpgsqlTimeSpan is less than or equivalent to second, false otherwise.

operator -(NpgsqlTimeSpan, NpgsqlTimeSpan)

Subtracts one NpgsqlTimeSpan from another.

public static NpgsqlTimeSpan operator -(NpgsqlTimeSpan x, NpgsqlTimeSpan y)

Parameters

x NpgsqlTimeSpan

The NpgsqlTimeSpan to subtract the other from.

y NpgsqlTimeSpan

The NpgsqlTimeSpan to subtract from the other.

Returns

NpgsqlTimeSpan

An NpgsqlTimeSpan whose values are the difference of the arguments

operator -(NpgsqlTimeSpan)

Negates an NpgsqlTimeSpan instance.

public static NpgsqlTimeSpan operator -(NpgsqlTimeSpan x)

Parameters

x NpgsqlTimeSpan

An NpgsqlTimeSpan.

Returns

NpgsqlTimeSpan

The negation of the argument.

operator +(NpgsqlTimeSpan)

Returns the instance.

public static NpgsqlTimeSpan operator +(NpgsqlTimeSpan x)

Parameters

x NpgsqlTimeSpan

Returns

NpgsqlTimeSpan

See Also