# Google Cloud Spanner v1 API - Class Interval (5.13.0-beta07)

5.13.0-beta07 5.13.0-beta06 5.12.0 (latest) 5.11.0 5.10.0 5.9.0 5.8.0 5.7.0 5.6.0 5.5.0 5.4.0 5.3.0 5.2.0 5.1.0 5.0.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.15.1 3.14.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0

    public sealed class Interval

Reference documentation and code samples for the Google Cloud Spanner v1 API class Interval.

Represents the Spanner Interval type.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> Interval

## Inherited Members

[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype)

## Namespace

[Google.Cloud.Spanner.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1)

## Assembly

Google.Cloud.Spanner.V1.dll

## Properties

### Days

    public int Days { get; }

Day portion of this interval.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### MaxValue

    public static Interval MaxValue { get; }

Represents the maximum possible value of an Interval.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` |   |

### MinValue

    public static Interval MinValue { get; }

Represents the minimum possible value of an Interval.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` |   |

### Months

    public int Months { get; }

Month portion of this interval.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### Nanoseconds

    public BigInteger Nanoseconds { get; }

Nanosecond portion of this interval.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.numerics.biginteger` |   |

### Zero

    public static Interval Zero { get; }

Represents the zero Interval value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` |   |

## Methods

### FromDays(int)

    public static Interval FromDays(int days)

Creates an interval from the given days.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `days` | `https://learn.microsoft.com/dotnet/api/system.int32` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` |   |

### FromMicroseconds(BigInteger)

    public static Interval FromMicroseconds(BigInteger microseconds)

Creates an interval from the given microseconds.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `microseconds` | `https://learn.microsoft.com/dotnet/api/system.numerics.biginteger` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` |   |

### FromMilliseconds(BigInteger)

    public static Interval FromMilliseconds(BigInteger milliseconds)

Creates an interval from the given milliseconds.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `milliseconds` | `https://learn.microsoft.com/dotnet/api/system.numerics.biginteger` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` |   |

### FromMonths(int)

    public static Interval FromMonths(int months)

Creates an interval from the given months.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `months` | `https://learn.microsoft.com/dotnet/api/system.int32` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` |   |

### FromMonthsDaysNanos(int, int, BigInteger)

    public static Interval FromMonthsDaysNanos(int months, int days, BigInteger nanos)

Creates an interval from the given months, days and nanoseconds.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `months` | `https://learn.microsoft.com/dotnet/api/system.int32` |
| `days` | `https://learn.microsoft.com/dotnet/api/system.int32` |
| `nanos` | `https://learn.microsoft.com/dotnet/api/system.numerics.biginteger` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` |   |

### FromNanoseconds(BigInteger)

    public static Interval FromNanoseconds(BigInteger nanoseconds)

Creates an interval from the given nanoseconds.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `nanoseconds` | `https://learn.microsoft.com/dotnet/api/system.numerics.biginteger` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` |   |

### FromSeconds(decimal)

    public static Interval FromSeconds(decimal seconds)

Creates an interval from the given seconds.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `seconds` | `https://learn.microsoft.com/dotnet/api/system.decimal` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` |   |

### GetHashCode()

    public override int GetHashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

**Overrides** [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)

### Parse(string)

    public static Interval Parse(string text)

Parses the string represantion in ISO 8601 format of a duration returning its Interval equivalent.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `text` | `https://learn.microsoft.com/dotnet/api/system.string` The string representation of a duration in ISO 8601 format: P\[n\]Y\[n\]M\[n\]DT\[n\]H\[n\]M\[n\[.fraction\]\]S. - Each field has an individual sign. - Only seconds can be fractional with a maximum of 9 decimal positions for up to nanosecond precision. - Each part does not need to be normalized. For instance `P1Y21M45DT47H250M3.245D` is valid. - Not all parts need to be specified. For instance `P3M`, `PT4H5M`, `P3YT5M` are all valid. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` |   |

### ToString()

    public override string ToString()

Returns the ISO 8601 string representation of this Interval.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Overrides** [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

### TryParse(string, out Interval)

    public static bool TryParse(string text, out Interval interval)

Parses the string represantion in ISO 8601 format of a duration returning its Interval equivalent, if possible.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `text` | `https://learn.microsoft.com/dotnet/api/system.string` The string representation of a duration in ISO 8601 format: P\[n\]Y\[n\]M\[n\]DT\[n\]H\[n\]M\[n\[.fraction\]\]S. |
| `interval` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Interval` The resulting Interval value, if parsing was succesful. null otherwise. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |