Noda Time
Show / Hide Table of Contents

Class DurationConstruction

Extension methods for constructing Duration values.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Inheritance
Object
DurationConstruction
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
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 net45, netstandard1.3, 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(Int32)

Constructs a duration with the specified number of days.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Days(this int days)
Parameters
Type Name Description
Int32 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 net45, netstandard1.3, 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(Int32)

Constructs a duration with the specified number of hours.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Hours(this int hours)
Parameters
Type Name Description
Int32 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 net45, netstandard1.3, 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(Int32)

Constructs a duration with the specified number of milliseconds.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Milliseconds(this int milliseconds)
Parameters
Type Name Description
Int32 milliseconds The desired number of milliseconds.
Returns
Type Description
Duration A duration with the specified number of milliseconds.

Milliseconds(Int64)

Constructs a duration with the specified number of milliseconds.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Milliseconds(this long milliseconds)
Parameters
Type Name Description
Int64 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 net45, netstandard1.3, 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(Int32)

Constructs a duration with the specified number of minutes.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Minutes(this int minutes)
Parameters
Type Name Description
Int32 minutes The desired number of minutes.
Returns
Type Description
Duration A duration with the specified number of minutes.

Minutes(Int64)

Constructs a duration with the specified number of minutes.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Minutes(this long minutes)
Parameters
Type Name Description
Int64 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 net45, netstandard1.3, 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(Int32)

Constructs a duration with the specified number of nanoseconds.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Nanoseconds(this int nanoseconds)
Parameters
Type Name Description
Int32 nanoseconds The desired number of nanoseconds.
Returns
Type Description
Duration A duration with the specified number of nanoseconds.

Nanoseconds(Int64)

Constructs a duration with the specified number of nanoseconds.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Nanoseconds(this long nanoseconds)
Parameters
Type Name Description
Int64 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 net45, netstandard1.3, 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(Int32)

Constructs a duration with the specified number of seconds.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Seconds(this int seconds)
Parameters
Type Name Description
Int32 seconds The desired number of seconds.
Returns
Type Description
Duration A duration with the specified number of seconds.

Seconds(Int64)

Constructs a duration with the specified number of seconds.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Seconds(this long seconds)
Parameters
Type Name Description
Int64 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 net45, netstandard1.3, 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(Int32)

Constructs a duration with the specified number of ticks.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Ticks(this int ticks)
Parameters
Type Name Description
Int32 ticks The desired number of ticks.
Returns
Type Description
Duration A duration with the specified number of ticks.

Ticks(Int64)

Constructs a duration with the specified number of ticks.
Since 2.0.x
Availability net45, netstandard1.3, netstandard2.0
Declaration
public static Duration Ticks(this long ticks)
Parameters
Type Name Description
Int64 ticks The desired number of ticks.
Returns
Type Description
Duration A duration with the specified number of ticks.
In this article
Back to top Generated by DocFX