User-visible changes from 1.0.0-beta1 onwards. See the project repository for more details.
Major features:
API changes:
Newly-obsolete members:
API changes for NodaTime.Testing:
Bug fixes:
Other:
API changes:
OffsetDateTime.Comparer and ZonedDateTime.Comparer,
IComparer<T> implementations that compare values by either the local
date/time or the underlying instantTzdbDateTimeZoneSource.WindowsZones renamed to WindowsMappingZoneEqualityComparer converted to use factory methods rather than
multiple constructors; some options' names changedMajor features:
API changes:
DateTimeZone.GetZoneIntervals methods return a sequence of zone
intervals which cover a particular interval (issue 172)ZoneEqualityComparer class allows time zones to be compared for
equality with varying degrees of strictness, over a given intervalLocalDate, LocalTime, LocalDateTime, and ZonedDateTime now
implement the non-generic IComparable interface (explicitly, to
avoid accidental use)TzdbDateTimeZoneSource:
Aliases and CanonicalIdMap properties, which together provide
bidirectional mappings between a canonical TZDB ID and its aliases
(issue 32)WindowsMapping property (was WindowsZones in -rc1), which
exposes details of the CLDR mapping between TZDB and Windows time zone
IDs (issue 82)ZoneLocations property, which exposes the location data from
zone.tab and iso3166.tab (issue 194)TzdbVersion property, which returns the TZDB version string
(e.g. "2013a")TzdbDateTimeZoneSource:
Default property, which provides access to the underlying source
of TZDB data distributed with Noda Time (issue 144)FromStream(), which can be used to create a source using data in
the new format produced by ZoneInfoCompiler (later renamed to NodaTime.TzdbCompiler)Validate() method, which allows for optional validation of
source data (previously, this was performed on every load)LocalDateTime patterns can now parse times of the form 24:00:00,
indicating midnight of the following day (issue 153)Instant:
From(Ticks,Milliseconds,Seconds)SinceUnixEpoch (issue 142)LocalTime:
From(Ticks,Milliseconds,Seconds)SinceMidnight (issue 148)LocalDateTime.InUtc() and WithOffset(), convenience conversions
from LocalDateTime to a (UTC) ZonedDateTime or OffsetDateTime
(issue 142)Date and TimeOfDay properties to ZonedDateTime and
OffsetDateTime, which provide a LocalDate and LocalTime directly,
rather than needing to go via the LocalDateTime property (issue 186)Period.FromMilliseconds(), obsoleting the misnamed
FromMillseconds() (issue 149)DateTimeZoneNotFoundException, which is used in place of the
.NET TimeZoneNotFoundException (which does not exist in the PCL);
on desktop builds, the new type extends the latter for compatibilityInvalidNodaDataException, which is now used to consistently
report problems reading time zone data; this replaces (inconsistent) use
of the .NET InvalidDataException type, which is also not available in
the PCLNewly-obsolete members:
DateTimeZoneProviders.Default, which use should be replaced by
existing equivalent property DateTimeZoneProviders.TzdbPeriod.FromMillseconds(), which was a typo for the newly-introduced
Period.FromMilliseconds()TzdbDateTimeZoneSource constructors, which construct a source using
TZDB data in the older resource-based format; the newer format should be
provided to the new TzdbDateTimeZoneSource.FromStream() method instead
(or, for the embedded resources, the new TzdbDateTimeZoneSource.Default
property should be used directly)API changes for NodaTime.Testing:
FakeDateTimeZoneSource, which is exactly what it sounds like
(issue 83)MultiTransitionDateTimeZone, a time zone with multiple
transitions, complementing the existing SingleTransitionDateTimeZoneSingleTransitionDateTimeZone.Transition property that returns
the transition point of the fake zoneSingleTransitionDateTimeZone
that allows the time zone ID to be specifiedBug fixes:
NodaIntervalConverter now handles values
embedded in a larger object being deserialized (issue 191)NullReferenceException when asked for a value in 2040
(and possibly other times). Other time zones should not be affected
(issue 174)LocalDateTime and ZonedDateTime now have non-crashing behaviour when
initialised via default (parameterless) constructors (issue 116)Other:
No API changes; this release was purely to fix a problem with the NodaTime.Testing package.
API changes:
CalendarSystem.Id property that returns a unique ID for a
calendar system, along with the ForId() factory method and Ids static
property; ToString() now returns the calendar ID rather than the namec custom format specifier for local date values,
which includes the calendar ID, representing the calendar system; custom format specifier to parse both comma
and period for fractions of a second; InstantPattern.ExtendedIsoPattern,
LocalTimePattern.ExtendedIsoPattern, and
LocalDateTimePattern.ExtendedIsoPattern now accept both as separators
(issues 140 and 141)r standard pattern for LocalDateTime that includes
the calendar systemCreateWithInvariantInfo() method on the pattern types to
CreateWithInvariantCulture() (issue 137)Other:
API changes:
DateTimeZone.GetOffsetFromUtc() to DateTimeZone.GetUtcOffset() to
match the BCL (issue 121)LocalDate.FromWeekYearWeekAndDay() (issue 120)Tick, SecondOfDay and MillisecondOfDay properties removed from
time-based types (issue 103)NodaCultureInfo and NodaFormatInfo types (issue 131 and
related issues), removed the FormatInfo property and WithFormatInfo()
method on pattern types, and changed the culture-specific pattern factory
methods to take a CultureInfo rather than a NodaFormatInfoEmptyDateTimeZoneSourcesealed: PeriodPattern, BclDateTimeZoneProvider,
BclDateTimeZoneSource, DateTimeZoneCache, and ZoneInterval, along
with various exception types and
NodaTime.Testing.SingleTransitionDateTimeZoneTzdbDateTimeZoneSource
(VersionKey, etc) are now internalBug fixes:
BclDateTimeZone not working the same way as a BCL
TimeZoneInfo (issues 114, 115, and
122)Other:
API changes:
DateTimeZone from an ID:
IDateTimeZoneProvider (SPI for time zones) renamed to
IDateTimeZoneSource, along with similar renaming for the built-in
sourcesIDateTimeZoneProvider aimed at callers, with caching
assumedDateTimeZoneProviders with static properties to access the
built-in providers: TZDB, BCL and default (currently TZDB)DateTimeZone static methods in favour of always going
via an IDateTimeZoneProvider implementationDateTimeZoneCache now public and implements IDateTimeZoneProviderDateTimeZone no longer has internal abstract methods, making third-party
implementations possible (issue 77)DateTimeZone now implements IEquatable<DateTimeZone>, and documents what
it means for time zones to be equal (issue 81)OffsetDateTime representing a local date/time and an offset
from UTC, but not full time zone informationG, which is like g but using
"Z" for zero; also available as OffsetPattern.GeneralInvariantPatternWithZPeriod and PeriodBuilder no longer differentiate between absent and zero
components (to the extent that they did at all): Units has been removed
from Period, period formatting now omits all zero values unconditionally,
and the Year (etc) properties on PeriodBuilder are no longer nullable
(issue 90)Instant, LocalDate, LocalDateTime, and Offset in favour of the
pattern-based API (issue 87)Duration.ToString() and Interval.ToString() now return more descriptive
text
Removed DateTimeZone.GetSystemDefaultOrNull(); callers should use the
provider's GetSystemDefault() method and (if necessary) catch the
TimeZoneNotFoundException that it can throw (issue 61)
Removed DateTimeZone.UtcId and DateTimeZone.IsFixed (issues 64
and 62)
Removed most of the convenience static properties on Duration (e.g.
Duration.OneStandardDay) in favour of the existing static methods; removed
MinValue and MaxValue, and added Epsilon (issue 70)
Removed Instant.BeginningOfTimeLabel and Instant.EndOfTimeLabel
Instant.InIsoUtc renamed to InUtc
Instant.UnixEpoch moved to NodaConstants.UnixEpoch;
NodaConstants.DateTimeEpochTicks replaced by BclEpoch
Added Instant.PlusTicks()
LocalDate.LocalDateTime property changed to LocalDate.AtMidnight() method
(issue 56)
LocalTime now implements IComparable<LocalTime> (issue 51)
Added a LocalTime constructor taking hours and minutes (issue 53)
Removed "component" properties from Offset, and renamed the "total"
properties to just Ticks and Milliseconds
Removed Offset.Create() methods (and moved them in slightly different form
in a new internal TestObjects class in NodaTime.Test)
Added Period.ToDuration() (issue 55) and Period.CreateComparer()
(issue 69)
Period.Empty renamed to Period.Zero (as part of issue 90)
PeriodBuilder no longer implements IEquatable<PeriodBuilder>
(issue 91)
Removed SystemClock.SystemNow in favour of using SystemClock.Instance.Now
if you really have to
Added ZonedDateTime.ToOffsetDateTime(), which returns the OffsetDateTime
equivalent to a ZonedDateTime
Removed the Buddhist Era (as there is no Buddhist calendar implementation)
NodaTime.Testing.StubClock renamed to FakeClock, and gains an
auto-advance option (issues 72 and 73)
NodaTime.Testing.TimeZones.SingleTransitionZone renamed to
SingleTransitionDateTimeZone
Bug fixes:
Introduction
Core
Advanced
Library