Noda Time
Show / Hide Table of Contents

Namespace NodaTime

The NodaTime namespace contains the core types for Noda Time, including the main public classes for time zone and calendar support which have implementations (and less frequently used types) in other namespaces. For formatting and parsing functionality, see the NodaTime.Text namespace.

Classes

AmbiguousTimeException

Exception thrown to indicate that the specified local date/time occurs twice in a particular time zone due to daylight saving time changes.

CalendarSystem

A calendar system maps the non-calendar-specific "local time line" to human concepts such as years, months and days.

DateAdjusters

Factory class for date adjusters: functions from LocalDate to LocalDate, which can be applied to LocalDate, LocalDateTime, and OffsetDateTime.

DateInterval

An interval between two dates.

DateTimeZone

Represents a time zone - a mapping between UTC and local time. A time zone maps UTC instants to local times - or, equivalently, to the offset from UTC at any particular instant.

DateTimeZoneProviders

Static access to date/time zone providers built into Noda Time and for global configuration where this is unavoidable. All properties are thread-safe, and the providers returned by the read-only properties cache their results.

NodaConstants

Useful constants, mostly along the lines of "number of milliseconds in an hour".

OffsetDateTime.Comparer

Base class for OffsetDateTime comparers.

Period

Represents a period of time expressed in human chronological terms: hours, days, weeks, months and so on.

PeriodBuilder

A mutable builder class for Period values. Each property can be set independently, and then a Period can be created from the result using the Build() method.

SkippedTimeException

Exception thrown to indicate that the specified local time doesn't exist in a particular time zone due to daylight saving time changes.

SystemClock

Singleton implementation of IClock which reads the current system time. It is recommended that for anything other than throwaway code, this is only referenced in a single place in your code: where you provide a value to inject into the rest of your application, which should only depend on the interface.

TimeAdjusters

Factory class for time adjusters: functions from LocalTime to LocalTime, which can be applied to LocalTime, LocalDateTime, and OffsetDateTime.

ZonedClock

A clock with an associated time zone and calendar. This is effectively a convenience class decorating an IClock.

ZonedDateTime.Comparer

Base class for ZonedDateTime comparers.

Structs

AnnualDate

Represents an annual date (month and day) in the ISO calendar but without a specific year, typically for recurrent events such as birthdays, anniversaries, and deadlines.

Duration

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

Instant

Represents an instant on the global timeline, with nanosecond resolution.

Interval

An interval between two instants in time (start and end).

LocalDate

LocalDate is an immutable struct representing a date within the calendar, with no reference to a particular time zone or time of day.

LocalDateTime

A date and time in a particular calendar system. A LocalDateTime value does not represent an instant on the global time line, because it has no associated time zone: "November 12th 2009 7pm, ISO calendar" occurred at different instants for different people around the world.

LocalTime

LocalTime is an immutable struct representing a time of day, with no reference to a particular calendar, time zone or date.

Offset

An offset from UTC in seconds. A positive value means that the local time is ahead of UTC (e.g. for Europe); a negative value means that the local time is behind UTC (e.g. for America).

OffsetDate

A combination of a LocalDate and an Offset, to represent a date at a specific offset from UTC but without any time-of-day information.

OffsetDateTime

A local date and time in a particular calendar system, combined with an offset from UTC. This is broadly similar to System.DateTimeOffset in the BCL.

OffsetTime

A combination of a LocalTime and an Offset, to represent a time-of-day at a specific offset from UTC but without any date information.

ZonedDateTime

A LocalDateTime in a specific time zone and with a particular offset to distinguish between otherwise-ambiguous instants. A ZonedDateTime is global, in that it maps to a single Instant.

Interfaces

IClock

Represents a clock which can return the current time as an Instant.

IDateTimeZoneProvider

Provides stable, performant time zone data.

Enums

IsoDayOfWeek

Equates the days of the week with their numerical value according to ISO-8601. This corresponds with System.DayOfWeek except for Sunday, which is 7 in the ISO numbering and 0 in System.DayOfWeek.

PeriodUnits

The units within a Period. When a period is created to find the difference between two local values, the caller may specify which units are required - for example, you can ask for the difference between two dates in "years and weeks". Units are always applied largest-first in arithmetic.
In this article
Back to top Generated by DocFX