Class DurationConstruction
Extension methods for constructing Duration values.
Since 2.0.x
Availability netstandard2.0
Inherited Members
Namespace: NodaTime.Testing.Extensions
Assembly: NodaTime.Testing.dll
Syntax
public static class DurationConstruction
Methods
Days(double)
Constructs a duration with the specified number of days.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Days(this double days)
Parameters
Type | Name | Description |
---|---|---|
double | days | The desired number of days. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of days. |
Days(int)
Constructs a duration with the specified number of days.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Days(this int days)
Parameters
Type | Name | Description |
---|---|---|
int | days | The desired number of days. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of days. |
Hours(double)
Constructs a duration with the specified number of hours.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Hours(this double hours)
Parameters
Type | Name | Description |
---|---|---|
double | hours | The desired number of hours. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of hours. |
Hours(int)
Constructs a duration with the specified number of hours.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Hours(this int hours)
Parameters
Type | Name | Description |
---|---|---|
int | hours | The desired number of hours. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of hours. |
Milliseconds(double)
Constructs a duration with the specified number of milliseconds.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Milliseconds(this double milliseconds)
Parameters
Type | Name | Description |
---|---|---|
double | milliseconds | The desired number of milliseconds. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of milliseconds. |
Milliseconds(int)
Constructs a duration with the specified number of milliseconds.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Milliseconds(this int milliseconds)
Parameters
Type | Name | Description |
---|---|---|
int | milliseconds | The desired number of milliseconds. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of milliseconds. |
Milliseconds(long)
Constructs a duration with the specified number of milliseconds.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Milliseconds(this long milliseconds)
Parameters
Type | Name | Description |
---|---|---|
long | milliseconds | The desired number of milliseconds. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of milliseconds. |
Minutes(double)
Constructs a duration with the specified number of minutes.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Minutes(this double minutes)
Parameters
Type | Name | Description |
---|---|---|
double | minutes | The desired number of minutes. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of minutes. |
Minutes(int)
Constructs a duration with the specified number of minutes.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Minutes(this int minutes)
Parameters
Type | Name | Description |
---|---|---|
int | minutes | The desired number of minutes. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of minutes. |
Minutes(long)
Constructs a duration with the specified number of minutes.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Minutes(this long minutes)
Parameters
Type | Name | Description |
---|---|---|
long | minutes | The desired number of minutes. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of minutes. |
Nanoseconds(double)
Constructs a duration with the specified number of nanoseconds.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Nanoseconds(this double nanoseconds)
Parameters
Type | Name | Description |
---|---|---|
double | nanoseconds | The desired number of nanoseconds. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of nanoseconds. |
Nanoseconds(int)
Constructs a duration with the specified number of nanoseconds.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Nanoseconds(this int nanoseconds)
Parameters
Type | Name | Description |
---|---|---|
int | nanoseconds | The desired number of nanoseconds. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of nanoseconds. |
Nanoseconds(long)
Constructs a duration with the specified number of nanoseconds.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Nanoseconds(this long nanoseconds)
Parameters
Type | Name | Description |
---|---|---|
long | nanoseconds | The desired number of nanoseconds. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of nanoseconds. |
Seconds(double)
Constructs a duration with the specified number of seconds.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Seconds(this double seconds)
Parameters
Type | Name | Description |
---|---|---|
double | seconds | The desired number of seconds. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of seconds. |
Seconds(int)
Constructs a duration with the specified number of seconds.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Seconds(this int seconds)
Parameters
Type | Name | Description |
---|---|---|
int | seconds | The desired number of seconds. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of seconds. |
Seconds(long)
Constructs a duration with the specified number of seconds.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Seconds(this long seconds)
Parameters
Type | Name | Description |
---|---|---|
long | seconds | The desired number of seconds. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of seconds. |
Ticks(double)
Constructs a duration with the specified number of ticks.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Ticks(this double ticks)
Parameters
Type | Name | Description |
---|---|---|
double | ticks | The desired number of ticks. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of ticks. |
Ticks(int)
Constructs a duration with the specified number of ticks.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Ticks(this int ticks)
Parameters
Type | Name | Description |
---|---|---|
int | ticks | The desired number of ticks. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of ticks. |
Ticks(long)
Constructs a duration with the specified number of ticks.
Since 2.0.x
Availability netstandard2.0
Declaration
public static Duration Ticks(this long ticks)
Parameters
Type | Name | Description |
---|---|---|
long | ticks | The desired number of ticks. |
Returns
Type | Description |
---|---|
Duration | A duration with the specified number of ticks. |