Npgsql Api Docs

NpgsqlInterval.Ticks Property

The total number of ticks(100ns units) contained. This is the resolution of the NpgsqlInterval 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 interval - resolution 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. NpgsqlInterval 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.

[Visual Basic]
Public ReadOnly Property Ticks As Long
[C#]
public long Ticks {get;}

See Also

NpgsqlInterval Class | NpgsqlTypes Namespace