Google Cloud Spanner v1 API - Class Interval (5.13.0-beta08)
Stay organized with collections
Save and categorize content based on your preferences.
public sealed class Interval
Reference documentation and code samples for the Google Cloud Spanner v1 API class Interval.
Represents the Spanner Interval type.
Namespace
Google.Cloud.Spanner.V1
Assembly
Google.Cloud.Spanner.V1.dll
Properties
Days
Day portion of this interval.
| Property Value |
| Type |
Description |
int |
|
MaxValue
public static Interval MaxValue { get; }
Represents the maximum possible value of an Interval.
| Property Value |
| Type |
Description |
Interval |
|
MinValue
public static Interval MinValue { get; }
Represents the minimum possible value of an Interval.
| Property Value |
| Type |
Description |
Interval |
|
Months
public int Months { get; }
Month portion of this interval.
| Property Value |
| Type |
Description |
int |
|
Nanoseconds
public BigInteger Nanoseconds { get; }
Nanosecond portion of this interval.
Zero
public static Interval Zero { get; }
Represents the zero Interval value.
| Property Value |
| Type |
Description |
Interval |
|
Methods
FromDays(int)
public static Interval FromDays(int days)
Creates an interval from the given days.
| Parameter |
| Name |
Description |
days |
int
|
FromMicroseconds(BigInteger)
public static Interval FromMicroseconds(BigInteger microseconds)
Creates an interval from the given microseconds.
| Parameter |
| Name |
Description |
microseconds |
BigInteger
|
FromMilliseconds(BigInteger)
public static Interval FromMilliseconds(BigInteger milliseconds)
Creates an interval from the given milliseconds.
| Parameter |
| Name |
Description |
milliseconds |
BigInteger
|
FromMonths(int)
public static Interval FromMonths(int months)
Creates an interval from the given months.
| Parameter |
| Name |
Description |
months |
int
|
FromMonthsDaysNanos(int, int, BigInteger)
public static Interval FromMonthsDaysNanos(int months, int days, BigInteger nanos)
Creates an interval from the given months, days and nanoseconds.
FromNanoseconds(BigInteger)
public static Interval FromNanoseconds(BigInteger nanoseconds)
Creates an interval from the given nanoseconds.
FromSeconds(decimal)
public static Interval FromSeconds(decimal seconds)
Creates an interval from the given seconds.
| Parameter |
| Name |
Description |
seconds |
decimal
|
GetHashCode()
public override int GetHashCode()
| Returns |
| Type |
Description |
int |
|
Overrides
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 |
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.
|
ToString()
public override string ToString()
Returns the ISO 8601 string representation of this Interval.
| Returns |
| Type |
Description |
string |
|
Overrides
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 |
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 |
Interval
The resulting Interval value, if parsing was succesful. null otherwise.
|
| Returns |
| Type |
Description |
bool |
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-07-26 UTC.
[null,null,["Last updated 2026-07-26 UTC."],[],[]]