NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #84 most downloaded on crates.io
Date and time library. Fully interoperable with the standard library. Mostly compatible with #![no_std].
Last release 2 months ago
01 Aug 2026
Ships unpredictably
gaps range from 8 days to 6 months
Nearly every release is documented
notes for 58 of the last 60 stable releases
8 versions withdrawn
withdrawn after publishing
12 years old
135 releases · first in 2014
See the changelog for details.
See the changelog for details.
DateIter::nth, ensuring correct behavior.UtcOffset.OffsetDateTime::from_unix_timestamp_nanos and UtcDateTime::from_unix_timestamp_nanos correctly
return None for all out-of-range values, rather than unexpectedly panicking in some situations.OffsetDateTime::checked_to_offset and UtcDateTime::checked_to_offset correctly return None
for all out-of-range values, rather than unexpectedly panicking in some situations.One column per quarter.
See the changelog for details.
See the changelog for details.
PrimitiveDateTime has been renamed to PlainDateTime.Duration has been renamed to SignedDuration.Date, Month, and Weekday. Relevant iterator methods have been
overridden to ensure maximum performance.For both PlainDateTime and SignedDuration, a non-deprecated type alias has been added for
backwards compatibility. The new names should be preferred.
powerfmt implementations) for various types has been changed
to () and made public. This guarantees that no additional metadata will be present.See the changelog for details.
See the changelog for details.
There are no publicly-facing changes in this release. It solely works around the cookie crate
relying on an implementation detail of time that was never part of the public API (and thus
subject to semver guarantees). The internal API has been reverted to the extent necessary for
cookie to compile. This measure is temporary; the internal change will be re-applied in an
yet-to-be-determined future release.
See the changelog for details.
See the changelog for details.
time! macro are parsed using the textual representation, ensuring
accuracy. Previously, they were parsed using the floating point representation, which could result
in a loss of precision and even invalid values.date! macro could previously create an invalid value that would then panic at compile time.
The macro now emits a proper error instead.See the changelog for details.
See the changelog for details.
time compiles with macros enabled. This version is otherwise identical to v0.3.50.Further gains when parsing with the non-deprecated parts of the RFC 2822 well-known format
This version was yanked because it would not compile when the macros feature was enabled.
Timestamp type[year] in a runtime-parsed version 3 format description when the large-dates feature is not
enabled now succeeds. This previously failed due to a missing #[cfg].Date arithmetic is improved in common situationsSee the changelog for details.
See the changelog for details.
See the changelog for details.
See the changelog for details.
This version was yanked due to a bug in the Rust compiler.
[subsecond digits:1+] is capped at 32 to avoid parsing unbounded
user input. Digits after the 9<sup>th</sup> have no semantic meaning.#[repr] for Weekday. The value of the variants is relied upon in multiple
locations for soundness. The practical effect of this change is nothing, as Rust has always mapped
C-like enums to 0..N in memory.format_description::parse is deprecated. It is recommended to use
format_description::parse_borrowed::<3> or format_description::parse_owned::<3>.unit module have a generic parameter, though this is currently not used for
much. Usage will be expanded in the future.unit module and the generic Unit type are permitted.rand 0.10[ignore] requires that the remaining input
not begin mid-codepoint.format:false is supported on [optional] components. This is not possible in version 1 and
version 2 format descriptions due to API compatibility.time::serde::format_description! macro uses a new, clearer syntax for version 3.
time::serde::format_description!(mod foo [Date] = "[year]-[month]-[day]");[year] defaults to range:standardconvert module has been renamed to unit.T in ISO 8601strftime format descriptions but the component is not. This
would previously panic.Huge performance gains across multiple areas, including:
DurationDisplay impls for all major typesstrftime parsingDepending on the area, gains range from 3× to even 11×.
See the changelog for details.
See the changelog for details.
The possibility of a stack exhaustion denial of service attack when parsing RFC 2822 has been eliminated. Previously, it was possible to craft input that would cause unbounded recursion. Now, the depth of the recursion is tracked, causing an error to be returned if it exceeds a reasonable limit.
This attack vector requires parsing user-provided input, with any type, using the RFC 2822 format.
Iso8601::PARSING) will error at compile time.date!(2026-W01-2) is now supported. Previously, a space was required between W and 01.[end] now has a trailing_input modifier which can either be prohibit (the default) or
discard. When it is discard, all remaining input is ignored. Note that if there are components
after [end], they will still attempt to be parsed, likely resulting in an error.u8, it is stored as u32. This would require multiple gigabytes of nested input to
overflow, at which point we've got other problems and trivial mitigations are available by
downstream users.See the changelog for details.
See the changelog for details.
All possible panics are now documented for the relevant methods.
The need to use #[serde(default)] when using custom serde formats is documented. This applies
only when deserializing an Option<T>.
Duration::nanoseconds_i128 has been made public, mirroring
std::time::Duration::from_nanos_u128.
Various methods for truncating components have been added, avoiding the need to call the fallible
replace methods multiple times.
For PrimitiveDateTime, UtcDateTime, and OffsetDateTime:
truncate_to_dayFor Time, PrimitiveDateTime, UtcDateTime, and OffsetDateTime:
truncate_to_hourtruncate_to_minutetruncate_to_secondtruncate_to_millisecondtruncate_to_microseconderror::ComponentRange, along with types that contain it, has been significantly
reduced.PartialOrd and Ord implementations of UtcOffset now return the expected result.time::format_description::StaticFormatDescription type alias for &'static [BorrowedFormatItem<'static>]. This is the type returned by the time::format
time::format_description::StaticFormatDescription type alias for &'static [BorrowedFormatItem<'static>]. This is the type returned by the
time::macros::format_description! macro.Duration are now const fn.Parsed are now const fn.serde dependency has been replaced with serde_core, This reduces compile times by not
including unused parts of serde.Date::from_julian_day uses a new algorithm, resulting in an approximately 16% performance
improvement. This method is used internally by numerous other methods.util::is_leap_year uses a new algorithm, resulting in an approximately 8% performance
improvement.Comparisons of PrimitiveDateTime, UtcDateTime, and OffsetDateTime with differing signs (i.e. one negative and one positive year) would return the inve
PrimitiveDateTime, UtcDateTime, and OffsetDateTime with differing signs (i.e.
one negative and one positive year) would return the inverse result of what was expected. This was
introduced in v0.3.42 and has been fixed.wasm-bindgen enabled serde_json.
This has been fixed by explicitly specifying the type in the relevant locations.In the convert module, any use of per with types that were not the same (such as Nanosecond::per(Second)) would not compile due to a bug. This has bee
rand 0.9convert module, any use of per with types that were not the same (such as
Nanosecond::per(Second)) would not compile due to a bug. This has been fixed.per_t method for all types in time::convert. This is similar to the existing per method, but can return any of the primitive numeric types that can re
Time::duration_untilTime::duration_sinceper_t method for all types in time::convert. This is similar to the existing per method, but
can return any of the primitive numeric types that can represent the result. This will cut down on
as casts while ensuring correctness. Type inference isn't perfect, so you may need to provide a
type annotation in some situations.impl PartialOrd for Month and impl Ord for Month; this assumes the months are in the same yearSystemTimeExt trait, adding methods for checked arithmetic with time::Duration and obtaining
the difference between two SystemTimes as a time::DurationUtcDateTime with rand (this was inadvertently omitted previously)impl core::error::Error for all error types (now available when the std feature is disabled)#[track_caller] has been added to all relevant methods.itoa has been removed, as the standard library now has similar functionality
by default.OffsetDateTime::to_offset and UtcDateTime::to_offset has been
fixed. The bug could result in a value that was invalid. It was unlikely to ever occur in
real-world code, as it involved passing a UTC offset that has never been used in any location.format_description!.Time, PrimitiveDateTime, UtcDateTime, and
OffsetDateTime. The first three have gains of approximately 85% (i.e. 6× faster).#[inline].Compatibility with the latest release of deranged. This fix is permanent and covers future similar changes upstream.
deranged. This fix is permanent and covers future
similar changes upstream.Visibility modifiers may now be added to the mod generated by time::format_description!.
mod generated by time::sere::format_description!.Doc tests run successfully with the default feature set.
Both of these were regressions in v0.3.38 and are now checked in CI.
The [year] component (in format descriptions) now supports a range modifier, which can be either standard or extended. The default is extended for bac
The [year] component (in format descriptions) now supports a range modifier, which can be
either standard or extended. The default is extended for backwards compatibility. This is
intended as a manner to opt out of the extended range when the large-dates feature is enabled.
When the large-dates feature is not enabled, the modifier has no effect.
UtcDateTime, which is semantically equivalent to an OffsetDateTime with UTC as its offset. The
advantage is that it is the same size as a PrimitiveDateTime and has improved operability with
well-known formats.
As part of this, there were some other additions:
utc_datetime! macro, which is similar to the datetime! macro but constructs a UtcDateTime.PrimitiveDateTime::as_utcOffsetDateTime::to_utcOffsetDateTime::checked_to_utctime::serde::timestamp::milliseconds_i64, which is a module to serialize/deserialize timestamps
as the Unix timestamp. The pre-existing module does this as an i128 where an i64 would
suffice. This new module should be preferred.
error::Format has had its source() implementation changed to no longer return a boxed value
from the ComponentRange variant. If you were explicitly expecting this, you will need to update
your code. The method API remains unchanged.[year repr:century] supports single-digit values.format_into methods accept ?Sized references.util::is_leap_yearutil::weeks_in_yearMonth::lengthDate::to_calendar_dateDate::monthDate::dayDate::from_julian_dayDate::to_julian_dayDue to this change, the time::local_offset module has been deprecated in its entirety. The get_soundness and set_soundness functions are now no-ops.
Time::MAX, equivalent to time!(23:59:59.999999999)[year repr:century] is now supported in format descriptions. When used in conjunction with
[year repr:last_two], there is sufficient information to parse a date. Note that with the
large-date feature enabled, there is an ambiguity when parsing the two back-to-back.strftime-style format descriptions, located at
time::format_description::parse_strftime_borrowed and
time::format_description::parse_strftime_ownedtime::util::refresh_tz and time::util::refresh_tz_unchecked, which updates information
obtained via the TZ environment variable. This is equivalent to the tzset syscall on Unix-like
systems, with and without built-in soundness checks, respectively.Month::length and util::days_in_month, replacing util::days_in_year_month.time::serde::format_description! rather than only paths. This also
drastically improves diagnostics when an invalid value is provided.Obtaining the system UTC offset on Unix-like systems should now succeed when multi-threaded.
However, if the TZ environment variable is altered, the program will not be aware of this until
time::util::refresh_tz or time::util::refresh_tz_unchecked is called. refresh_tz has the
same soundness requirements as obtaining the system UTC offset previously did, with the
requirements still being automatically enforced. refresh_tz_unchecked does not enforce these
requirements at the expense of being unsafe. Most programs should not need to call either
function.
Due to this change, the time::util::local_offset module has been deprecated in its entirety. The
get_soundness and set_soundness functions are now no-ops.
Note that while calls should succeed, success is not guaranteed in any situation. Downstream users should always be prepared to handle the error case.
Durations less than one second is now correct. It previously omitted
the negative sign.From<js_sys::Date> for OffsetDateTime now ensures sub-millisecond values are not erroneously
returned.FormatItem can be used as part of an import path. See [#675] for details.
FormatItem can be used as part of an import path. See #675 for details.Instant is deprecated. It is recommended to use std::Instant directly, importing time::InstantExt for interoperability with time::Duration.
Duration::checked_negext::InstantExt, which provides methods for using time::Duration with std::time::InstantInstant is deprecated. It is recommended to use std::time::Instant directly, importing
time::ext::InstantExt for interoperability with time::Duration.FormatItem has been renamed to BorrowedFormatItem, avoiding confusion with OwnedFormatItem.
An alias has been added for backwards compatibility.Duration is documented correctly. The previous documentation
contained an off-by-one error.Computing the local offset on Windows works again. It was broken in some cases in v0.3.32 and v0.3.33.
Computing the local offset on Windows works again. It was broken in some cases in v0.3.32 and v0.3.33.
Builds targeting wasm32-unknown-unknown now work again.
Builds targeting wasm32-unknown-unknown now work again.
Duration::time_fn is deprecated.
Date::replace_ordinalPrimitiveDateTime::replace_ordinalOffsetDateTime::replace_ordinalOffsetDateTime as a Unix timestamp with subsecond precision for serde.
time::serde::timestamp::millisecondstime::serde::timestamp::microsecondstime::serde::timestamp::nanosecondsDuration::time_fn is deprecated.The valid range of UtcOffset has been expanded from ±23:59:59 to ±25:59:59. This is to support the full POSIX range while permitting infallible negati
OffsetDateTime::new_in_offsetOffsetDateTime::new_utcUtcOffset has been expanded from ±23:59:59 to ±25:59:59. This is to support
the full POSIX range while permitting infallible negation.powerfmt::smart_display::SmartDisplay has been added for the main types in the library. These implementations ensure that values follow the requested
powerfmt::smart_display::SmartDisplay has been added for the main types in the library. These
implementations ensure that values follow the requested fill, width, and alignment when using
format! or similar macros. Display is implemented in terms of SmartDisplay.NumericalDuration or
NumericalStdDuration.Niche value optimization for Date has been added. Both Date and Option are four bytes.
Niche value optimization for Date has been added. Both Date and Option<Date> are four bytes.
Unit conversions have been added. It is now possible to write Second::per(Day), which returns
the number of seconds in one day. See the types in the time::convert module for more
information.
--cfg unsound_local_offset has been removed.#![feature(no_coverage)] was previously used internally for code coverage. It is no longer used,
so it has been removed.modifier::OffsetHour has been changed. This was unintentionally changed in
v0.3.17 and went unnoticed until now. The sign is now only present if needed by default, as was
the case previously. This does not affect any situation where format_description! or
format_description::parse is used.std::time::Duration to/from an OffsetDateTime will not result in
integer overflow internally. It will still panic if the result is out of range.All previously-existing locations of this variant have been deprecated and will no longer be returned.
Iso8601 format description have been added. This
avoids the need to manually configure the format.[end] component has been added. This is ignored during formatting, but is used to indicate
the end of input when parsing. If any input remains after this component, an error is returned.
This is useful when using the [first] component, as it avoids the need to reorder variants.UnexpectedTrailingCharacters error variant has been moved to ParseFromDescription. All
previously-existing locations of this variant have been deprecated and will no longer be returned.This sets the serde dependency requirement to >= 1.0.184 where the binaries have been removed.
This sets the serde dependency requirement to >= 1.0.184 where the binaries have been removed.
This release contains only a single change. serde is required to be a version prior to 1.0.171. This is due to the decision by the maintainer of serde
This release contains only a single change. serde is required to be a version prior to 1.0.171.
This is due to the decision by the maintainer of serde to include pre-built binaries that are
executed without the end user's knowledge. As of the time of publishing, the included binary has not
even been reproduced. This is a security risk, and the time project strongly opposes this
decision. While this may break some users' builds due to conflicting versions, it is a necessary
step to ensure the security.
Methods such as Time::replace_milliseconds would panic on some out-of-range values. This has been fixed.
Time::replace_milliseconds would panic on some out-of-range values. This has
been fixed.The subsecond component is taken into account when parsing the unix_timestamp component. If data is conflicting, the subsecond value takes precedence.
subsecond component is taken into account when parsing the unix_timestamp component. If
data is conflicting, the subsecond value takes precedence.Time with only the hour component is now supported. The minute and second, and
subsecond components are assumed to be zero.Parsed has been improved.Time, an error is returned if components are present but not consecutive. For
example, if hours and seconds are present, minutes will not be assumed to be zero.Duration::checked_div could return a slightly incorrect result in some
cases. This has been fixed.The minimum supported Rust version policy has been updated. See [the README][msrv-policy] for details.
Date::next_occurrenceDate::prev_occurrenceDate::nth_next_occurrenceDate::nth_prev_occurrenceWeekday::nth_prevMonth::nth_nextMonth::nth_prevThe minimum supported Rust version policy has been updated. See the README for details.
Duration::abs correctly returns Duration::MAX when near the minimum value. The nanoseconds
value was previously incorrect.OffsetDateTime::checked_to_offset
OffsetDateTime::checked_to_offsetAny formattable/parsable type can now be used with the time::format_description! macro.
time::serde::format_description! macro.Weekday::nth_nextThe minimum supported Rust version is now 1.63.0.
[ignore] component in format descriptions. A count modifier is required, indicating the number
of bytes to ignore when parsing.[unix_timestamp] component in format descriptions. This is currently only usable with
OffsetDateTime. Users can choose between seconds, milliseconds, microseconds, and nanoseconds,
and whether the sign is mandatory or optional.This includes the update to the format_description! macro, which was supposed to be included in 0.3.18.
This includes the update to the format_description! macro, which was supposed to be included in
0.3.18.
The minimum supported Rust version is now 1.62.0.
[first] and [optional] items can now be included in format descriptions. To parse this at
runtime, you must use the format_description::parse_owned method.format_description::parse_borrowedRUSTFLAGS="--cfg unsound_local_offset". End users may call
time::util::local_offset::set_soundness(time::util::local_offset::Soundness::Unsound). This
method is unsafe because it enables undefined behavior if its safety requirements are not
upheld. Note that libraries must not set this to Unsound, as it is impossible for a library
to guarantee end users uphold the required invariants.A side effect of this is that some errors have slightly changed. No existing API has been altered, so this is not a breaking change. However, you may…
time::serde::format_description! is reduced if not all feature
flags are active.cargo test --tests works with any configuration of feature flags. This occurs by spawning a
subprocess that passes --all-features. cargo test --doc works with most combinations of
feature flags, including the default. The combination of these changes means that crater will now
run on time.libc and num_threads are only included as dependencies when needed. They were previously
unconditionally included.time::format_description::parse_owned, which returns an OwnedFormatItem. This avoids "lifetime
hell", where all your structs now need a lifetime because a single field has one. Note that when
possible, the borrowed format item (just called FormatItem) is still preferred, as it has
significantly fewer allocations. The new OwnedFormatItem is usable for both formatting and
parsing, as you would expect.The serde-well-known feature flag is deprecated. The necessary features for an item to be enabled are indicated in documentation.
serde-well-known feature flag is deprecated. The necessary features for an item to be
enabled are indicated in documentation.consts can now be provided as the format description for time::serde::format_description!. The
const must be of type &[FormatItem<'_>], which is what is returned by the
time::macros::format_description! macro.
const TIME_FORMAT_ALT: &[FormatItem<'_>] = time::macros::format_description!("[hour]:[minute]");
time::serde::format_description!(time_format_alt, Time, TIME_FORMAT_ALT);
js-sysquickcheck-depitoatime-macrosBetter gating for tm_gmtoff extension. This should eliminate build failures on some untested platforms.
tm_gmtoff extension. This should eliminate build failures on some untested
platforms.Debug output for types are now human-readable. While this should not be relied upon, it is
currently the same as the output with Display.NaN is passed to Duration::from_secs_f32 or Duration::from_secs_f64.OffsetDateTime to another UtcOffset. This
occurred due to an old assumption in code that was no longer the case.The minimum supported Rust version is now 1.59.0.
Duration::unsigned_abs is now const fn.time::format_description::well_known::Iso8601 now has a default. This
means Iso8601 is the same as Iso8601::DEFAULT.Parsed struct has been reduced in size from 56 to 32 bytes (a 43% reduction).wasm builds other than those using wasm-bindgen work again.
wasm-bindgen work again.js-sys now supports obtaining the system's local UTC offset.
js-sys now supports obtaining the system's local UTC offset.Date operations has improved when using the large-dates feature.OffsetDateTime now stores the value in the attached UtcOffset, not
UTC. This leads to significant performance gains on nearly all OffsetDateTime methods.Times can no longer panic. This previously occurred in some situations where the
result was invalid.[#479]: regression when parsing optional values with serde
Serde support for non-self-describing formats
Duration::unsigned_abs, which returns a std::time::DurationDuration can now be formatted with a .N specifier, providing a shorter representation when
using Display.null as None on serde structsRfc3339.Rfc2822 has been improved.The following methods have been deprecated in favor of the new, signed equivalent methods. The pre-existing methods
time::serde::format_description!
time::format_description!, but it generates a module that can be used
in #[serde(with = "foo")]. This makes it far easier to serialize/deserialize a custom format.Date::replace_yearDate::replace_monthDate::replace_dayTime::replace_hourTime::replace_minuteTime::replace_secondTime::replace_millisecondTime::replace_microsecondTime::replace_nanosecondPrimitiveDateTime::replace_yearPrimitiveDateTime::replace_monthPrimitiveDateTime::replace_dayPrimitiveDateTime::replace_hourPrimitiveDateTime::replace_minutePrimitiveDateTime::replace_secondPrimitiveDateTime::replace_millisecondPrimitiveDateTime::replace_microsecondPrimitiveDateTime::replace_nanosecondOffsetDateTime::replace_yearOffsetDateTime::replace_monthOffsetDateTime::replace_dayOffsetDateTime::replace_hourOffsetDateTime::replace_minuteOffsetDateTime::replace_secondOffsetDateTime::replace_millisecondOffsetDateTime::replace_microsecondOffsetDateTime::replace_nanosecondParsed::offset_minute_signedParsed::offset_second_signedParsed::set_offset_minute_signedParsed::set_offset_second_signedParsed::with_offset_minute_signedParsed::with_offset_second_signederror::InvalidVariantimpl FromStr for Weekdayimpl FromStr for Monthimpl Display for DurationThe following methods have been deprecated in favor of the new, signed equivalent methods. The pre-existing methods
Parsed::offset_minuteParsed::offset_secondParsed::set_offset_minuteParsed::set_offset_secondParsed::with_offset_minuteParsed::with_offset_secondTryFromParsed::ComponentRange error
variant if the leap second could not occur at that given moment.This release is broken and has been yanked.
This release is broken and has been yanked.
Solaris and Illumos build again.
Solaris and Illumos build again.
PrimitiveDateTime::saturating_add
Date::saturating_addDate::saturating_subPrimitiveDateTime::saturating_addPrimitiveDateTime::saturating_subOffsetDateTime::saturating_addOffsetDateTime::saturating_subPrimitiveDatetime::MINPrimitiveDatetime::MAXRfc2822 format descriptionserde-well-known feature flag.num_threads crate.Attempts to obtain the local UTC offset will now succeed on Linux if the process is single-threaded. This does not affect other Unix platforms. As a r
Date::checked_addDate::checked_subPrimitiveDateTime::checked_addPrimitiveDateTime::checked_subOffsetDateTime::checked_addOffsetDateTime::checked_subErr value for any reason.These methods exist to permit construction in const contexts and may be removed (without being considered a breaking change) once impl const Default i…
error::DifferentVariant and Error::DifferentVariantimpl From<Component> for FormatItem<'_>impl TryFrom<FormatItem<'_>> for Componentimpl<'a> From<&'a [FormatItem<'_>]> for FormatItem<'a>impl<'a> TryFrom<FormatItem<'a>> for &[FormatItem<'a>]impl PartialEq<Component> for FormatItem<'_>impl PartialEq<FormatItem<'_>> for Componentimpl PartialEq<&[FormatItem<'_>]> for FormatItem<'_>impl PartialEq<FormatItem<'_>> for &[FormatItem<'_>]impl TryFrom<Error> for error::TryFromParsedimpl TryFrom<Error> for error::Parseimpl TryFrom<Error> for error::ParseFromDescriptionimpl TryFrom<Error> for error::InvalidFormatDescriptionimpl TryFrom<Error> for error::IndeterminateOffsetimpl TryFrom<Error> for error::Formatimpl TryFrom<Error> for error::ConversionRangeimpl TryFrom<Error> for error::ComponentRangeimpl TryFrom<error::TryFromParsed> for error::ComponentRangeimpl TryFrom<error::Parse> for error::TryFromParsedimpl TryFrom<error::Parse> for error::ParseFromDescriptionimpl TryFrom<error::Format> for std::io::Errorimpl Sum for Durationimpl Sum<&Duration> for Durationconst fn default() has been added to all modifiers that are structs. These methods exist to
permit construction in const contexts and may be removed (without being considered a breaking
change) once impl const Default is stabilized.FormatItem::Optional, which will consume the contained value if present but still succeed
otherwise.FormatItem::First, which will consume the first successful parse, ignoring any prior errors.UtcOffset component now indicates the error comes from the offset.The format_description! macro now supports the case_sensitive modifier.
Parsed::parse_itemParsed::parse_itemsParsed::parse_literalParsedformat_description! macro now supports the case_sensitive modifier.The minimum supported version is now 1.51.0.
Instant is now #[repr(transparent)]
Instant is now #[repr(transparent)]Date from its ISO year, week, and weekday now returns the correct value in all
circumstances. Previously, dates with an ISO year less than zero may have returned incorrect
values. This affects both the Date::from_iso_week_date method and the date! macro.The parser now accepts "5 PM" and similar as a valid time. Only the 12-hour clock hour and the AM/PM suffix may be present; any other components repre
Month now implements TryFrom<u8>From<Month> is now implemented for u8time! macro accepts the "5 PM" syntax with the same restriction.time! and datetime!) no longer accept "0:00 AM" and
similar. This was previously erroneously accepted.Per the policy in the README, this may be bumped within the 0.3 series without being a breaking change.
datetime! macro, which allows the construction of a statically verified PrimitiveDateTime or
OffsetDateTime.PrimitiveDateTime::replace_timePrimitiveDateTime::replace_dateOffsetDateTime::replace_timeOffsetDateTime::replace_dateOffsetDateTime::replace_date_timeOffsetDateTime::replace_offset#![no_alloc] supportDate::to_iso_week_date, replacing Date::iso_year_weekDate::MINDate::MAXUtcOffset::from_hmsUtcOffset::from_whole_secondsUtcOffset::as_hmsUtcOffset::whole_hoursUtcOffset::whole_minutesUtcOffset::minutes_past_hourUtcOffset::seconds_past_minuteUtcOffset::is_utcUtcOffset::is_positiveUtcOffset::is_negativeOffsetDateTime::sunday_based_weekOffsetDateTime::monday_based_weekPrimitiveDateTime::to_calendar_datePrimitiveDateTime::to_ordinal_datePrimitiveDateTime::to_iso_week_datePrimitiveDateTime::to_julian_dayOffsetDateTime::to_calendar_dateOffsetDateTime::to_ordinal_dateOffsetDateTime::to_iso_week_dateOffsetDateTime::to_julian_dayTime::as_hmsTime::as_hms_milliTime::as_hms_microTime::as_hms_nanoPrimitiveDateTime::as_hmsPrimitiveDateTime::as_hms_milliPrimitiveDateTime::as_hms_microPrimitiveDateTime::as_hms_nanoOffsetDateTime::to_hmsOffsetDateTime::to_hms_milliOffsetDateTime::to_hms_microOffsetDateTime::to_hms_nanoDuration::saturating_addDuration::saturating_subDuration::saturating_mulutil::days_in_year_monthMonthInstant::into_innerimpl AsRef<StdInstant> and impl Borrow<StdInstant> for InstantRUSTFLAGS. Further
information is available in the documentation.macros feature flag.OffsetDatetime::timestamp → OffsetDateTime::unix_timestampOffsetDatetime::timestamp_nanos → OffsetDateTime::unix_timestamp_nanosDate::try_from_ymd → Date::from_calendar_dateDate::try_from_yo → Date::from_ordinal_dateDate::try_from_iso_ywd → Date::from_iso_week_dateDate::as_ymd → Date::to_calendar_dateDate::as_yo → Date::to_ordinal_dateDate::try_with_hms → Date::with_hmsDate::try_with_hms_milli → Date::with_hms_milliDate::try_with_hms_micro → Date::with_hms_microDate::try_with_hms_nano → Date::with_hms_nanoTime::try_from_hms → Time::from_hmsTime::try_from_hms_milli → Time::from_hms_milliTime::try_from_hms_micro → Time::from_hms_microTime::try_from_hms_nano → Time::from_hms_nanoUtcOffset::try_local_offset_at → UtcOffset::local_offset_atUtcOffset::as_seconds → UtcOffset::whole_secondsOffsetDateTime::try_now_local → OffsetDateTime::now_localDate::week → Date::iso_weekPrimitiveDateTime::week → PrimitiveDateTime::iso_weekOffsetDateTime::week → OffsetDateTime::iso_weekDate::julian_day → Date::to_julian_dayDuration unit values, as well as the minimum and maximum, are now associated constants.OffsetDateTime::unix_epoch() → OffsetDateTime::UNIX_EPOCHTime::midnight() → Time::MIDNIGHTconst fn (on at least newer compilers)
Date::weekdayDate::next_dayDate::previous_dayPrimitiveDateTime::assume_offsetPrimitiveDateTime::weekdayDuration::checked_addDuration::checked_subDuration::checked_mulOffsetDateTime::from_unix_timestampOffsetDateTime::from_unix_timestamp_nanosOffsetDateTime::dateOffsetDateTime::timeOffsetDateTime::yearOffsetDateTime::monthOffsetDateTime::dayOffsetDateTime::ordinalOffsetDateTime::to_iso_week_dateOffsetDateTime::weekOffsetDateTime::weekdayOffsetDateTime::hourOffsetDateTime::minuteOffsetDateTime::secondOffsetDateTime::millisecondOffsetDateTime::microsecondOffsetDateTime::nanosecondOffsetDateTime::unix_timestampOffsetDateTime::unix_timestamp_nanosResult:
Date::from_julian_dayOffsetDateTime::from_unix_timestampOffsetDateTime::from_unix_timestamp_nanosOption:
Date::next_dayDate::previous_daylarge-dates
feature, this is increased to ±999,999. Enabling the feature has performance implications and
introduces ambiguities when parsing.local-offset feature:
UtcOffset::local_offset_atOffsetDateTime::now_localInstant is now guaranteed to be represented as a tuple struct containing a std::time::Instant.Date::to_julian_day now returns an i32 (was i64).Date::from_julian_day now accepts an i32 (was i64).Month enum is used instead of numerical values where appropriate.PreciseTimeSteadyTimeprecise_time_nsprecise_time_sInstant::toDuration::num_weeksDuration::num_daysDuration::num_hoursDuration::num_minutesDuration::num_secondsDuration::num_millisecondsDuration::num_microsecondsDuration::num_nanosecondsDuration::spanDuration::from_stdDuration::to_stdDate::from_ymdDate::from_yoDate::from_iso_ywdDate::with_hmsDate::with_hms_milliDate::with_hms_microDate::with_hms_nanoTime::from_hmsTime::from_hms_milliTime::from_hms_microTime::from_hms_nanoDate::todayTime::nowPrimitiveDateTime::nowPrimitiveDateTime::unix_epochPrimitiveDateTime::from_unix_timestampPrimitiveDateTime::timestampOffsetDateTime::nowimpl Sub<SystemTime> for PrimitiveDateTimeimpl Sub<PrimitiveDateTime> for SystemTimeimpl PartialEq<SystemTime> for PrimitiveDateTimeimpl PartialEq<PrimitiveDateTime> for SystemTimeimpl PartialOrd<SystemTime> for PrimitiveDateTimeimpl PartialOrd<PrimitiveDateTime> for SystemTimeimpl From<SystemTime> for PrimitiveDateTimeimpl From<PrimitiveDateTime> for SystemTimeUtcOffset::local_offset_at — assumed UTC if unable to determine local offsetOffsetDateTime::now_local — assumed UTC if unable to determine local offsetDuration::signPrimitiveDateTime::using_offsetSigndays_in_yearis_leap_yearvalidate_format_stringweeks_in_yearComponentRangeErrorConversionRangeErrorIndeterminateOffsetErrorParseErrorNumericalDurationNumericalStdDurationNumericalStdDurationShortfmt::Error, indicating
an error unrelated to the time crate.
Time::lazy_formatDate::lazy_formatUtcOffset::lazy_formatPrimitiveDateTime::lazy_formatOffsetDateTime::lazy_formatprelude module has been removed in its entirety.Date::iso_year_week in favor of Date::to_iso_week_datePrimitiveDateTime::iso_year_weekOffsetDateTime::iso_year_weekUtcOffset::east_hoursUtcOffset::west_hoursUtcOffset::hoursUtcOffset::east_minutesUtcOffset::west_minutesUtcOffset::minutesUtcOffset::east_secondsUtcOffset::west_secondsUtcOffset::secondsDate::month_dayPrimitiveDateTime::month_dayOffsetDateTime::month_dayWeekday::iso_weekday_number (identical to Weekday::number_from_monday)ext::NumericalStdDurationShortNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →