Duration StructureNoda Time
Represents a fixed (and calendar-independent) length of time.

Namespace: NodaTime
Assembly: NodaTime (in NodaTime.dll) Version: (1.3.1)

public struct Duration : IEquatable<Duration>, 
	IComparable<Duration>, IComparable, IXmlSerializable, IFormattable, 

A duration is a length of time defined by an integral number of 'ticks', where a tick is equal to 100 nanoseconds. There are 10,000 ticks in a millisecond. Although durations are usually used with a positive number of ticks, negative durations are valid, and may occur naturally when e.g. subtracting an earlier Instant from a later one.

A duration represents a fixed length of elapsed time along the time line that occupies the same amount of time regardless of when it is applied. In contrast, Period represents a period of time in calendrical terms (hours, days, and so on) that may vary in elapsed time when applied.

In general, use Duration to represent durations applied to global types like Instant and ZonedDateTime; use Period to represent a period applied to local types like LocalDateTime.

Version Information

Available since: 1.0.0
Supported in the PCL? Yes
Thread Safety

This type is an immutable value type. See the thread safety section of the user guide for more information.
See Also