Update Rust crate time to 0.3 - autoclosed #12
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "renovate/time-0.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
0.2
->0.3
Release Notes
time-rs/time
v0.3.16
Compare Source
Changed
serde-well-known
feature flag is deprecated. The necessary features for an item to beenabled are indicated in documentation.
Added
const
s can now be provided as the format description fortime::serde::format_description!
. Theconst
must be of type&[FormatItem<'_>]
, which is what is returned by thetime::macros::format_description!
macro.Compatibility
was unsupported. These flags are:
js-sys
quickcheck-dep
itoa
time-macros
v0.3.15
Compare Source
Changed
tm_gmtoff
extension. This should eliminate build failures on some untestedplatforms.
Debug
output for types are now human-readable. While this should not be relied upon, it iscurrently the same as the output with
Display
.panic. This was previously only the case in debug mode.
NaN
is passed toDuration::from_secs_f32
orDuration::from_secs_f64
.Fixed
OffsetDateTime
to anotherUtcOffset
. Thisoccurred due to an old assumption in code that was no longer the case.
v0.3.14
Compare Source
Changed
Duration::unsigned_abs
is nowconst fn
.time::format_description::well_known::Iso8601
now has a default. Thismeans
Iso8601
is the same asIso8601::DEFAULT
.Parsed
struct has been reduced in size from 56 to 32 bytes (a 43% reduction).v0.3.13
Compare Source
Fixed
wasm-bindgen
work again.v0.3.12
Compare Source
Added
js-sys
now supports obtaining the system's local UTC offset.Changed
Date
operations has improved when using thelarge-dates
feature.OffsetDateTime
now stores the value in the attachedUtcOffset
, notUTC. This leads to significant performance gains on nearly all
OffsetDateTime
methods.Fixed
Time
s can no longer panic. This previously occurred in some situations where theresult was invalid.
v0.3.11
Compare Source
Fixed
v0.3.10
Compare Source
Added
Duration::unsigned_abs
, which returns astd::time::Duration
Duration
can now be formatted with a.N
specifier, providing a shorter representation whenusing
Display
.null
asNone
on serde structsFixed
Rfc3339
.Changed
Rfc2822
has been improved.only serves to catch bugs and is disabled in release mode.
v0.3.9
Added
time::serde::format_description!
time::format_description!
, but it generates a module that can be usedin
#[serde(with = "foo")]
. This makes it far easier to serialize/deserialize a custom format.Date::replace_year
Date::replace_month
Date::replace_day
Time::replace_hour
Time::replace_minute
Time::replace_second
Time::replace_millisecond
Time::replace_microsecond
Time::replace_nanosecond
PrimitiveDateTime::replace_year
PrimitiveDateTime::replace_month
PrimitiveDateTime::replace_day
PrimitiveDateTime::replace_hour
PrimitiveDateTime::replace_minute
PrimitiveDateTime::replace_second
PrimitiveDateTime::replace_millisecond
PrimitiveDateTime::replace_microsecond
PrimitiveDateTime::replace_nanosecond
OffsetDateTime::replace_year
OffsetDateTime::replace_month
OffsetDateTime::replace_day
OffsetDateTime::replace_hour
OffsetDateTime::replace_minute
OffsetDateTime::replace_second
OffsetDateTime::replace_millisecond
OffsetDateTime::replace_microsecond
OffsetDateTime::replace_nanosecond
Parsed::offset_minute_signed
Parsed::offset_second_signed
Parsed::set_offset_minute_signed
Parsed::set_offset_second_signed
Parsed::with_offset_minute_signed
Parsed::with_offset_second_signed
error::InvalidVariant
impl FromStr
forWeekday
impl FromStr
forMonth
impl Display for Duration
Deprecated
The following methods have been deprecated in favor of the new, signed equivalent methods. The
pre-existing methods
Parsed::offset_minute
Parsed::offset_second
Parsed::set_offset_minute
Parsed::set_offset_second
Parsed::with_offset_minute
Parsed::with_offset_second
Changed
TryFromParsed::ComponentRange
errorvariant if the leap second could not occur at that given moment.
v0.3.8
This release is broken and has been yanked.
v0.3.7
Compare Source
Fixed
Solaris and Illumos build again.
v0.3.6
Compare Source
Added
Date::saturating_add
Date::saturating_sub
PrimitiveDateTime::saturating_add
PrimitiveDateTime::saturating_sub
OffsetDateTime::saturating_add
OffsetDateTime::saturating_sub
PrimitiveDatetime::MIN
PrimitiveDatetime::MAX
Rfc2822
format descriptionserde-well-known
feature flag.Changed
num_threads
crate.format fails to deserialize.
Fixed
v0.3.5
Compare Source
Added
Date::checked_add
Date::checked_sub
PrimitiveDateTime::checked_add
PrimitiveDateTime::checked_sub
OffsetDateTime::checked_add
OffsetDateTime::checked_sub
Changed
single-threaded. This does not affect other Unix platforms. As a reminder, the relevant methods
are fallible and may return an
Err
value for any reason.v0.3.4
Compare Source
Added
error::DifferentVariant
andError::DifferentVariant
impl From<Component> for FormatItem<'_>
impl TryFrom<FormatItem<'_>> for Component
impl<'a> From<&'a [FormatItem<'_>]> for FormatItem<'a>
impl<'a> TryFrom<FormatItem<'a>> for &[FormatItem<'a>]
impl PartialEq<Component> for FormatItem<'_>
impl PartialEq<FormatItem<'_>> for Component
impl PartialEq<&[FormatItem<'_>]> for FormatItem<'_>
impl PartialEq<FormatItem<'_>> for &[FormatItem<'_>]
impl TryFrom<Error> for error::TryFromParsed
impl TryFrom<Error> for error::Parse
impl TryFrom<Error> for error::ParseFromDescription
impl TryFrom<Error> for error::InvalidFormatDescription
impl TryFrom<Error> for error::IndeterminateOffset
impl TryFrom<Error> for error::Format
impl TryFrom<Error> for error::ConversionRange
impl TryFrom<Error> for error::ComponentRange
impl TryFrom<error::TryFromParsed> for error::ComponentRange
impl TryFrom<error::Parse> for error::TryFromParsed
impl TryFrom<error::Parse> for error::ParseFromDescription
impl TryFrom<error::Format> for std::io::Error
impl Sum for Duration
impl Sum<&Duration> for Duration
const fn default()
has been added to all modifiers that arestruct
s. These methods exist topermit construction in
const
contexts and may be removed (without being considered a breakingchange) once
impl const Default
is stabilized.FormatItem::Optional
, which will consume the contained value if present but still succeedotherwise.
FormatItem::First
, which will consume the first successful parse, ignoring any prior errors.Fixed
UtcOffset
component now indicates the error comes from the offset.v0.3.3
Compare Source
Added
Parsed::parse_item
Parsed::parse_items
Parsed::parse_literal
Parsed
format_description!
macro now supports thecase_sensitive
modifier.Changed
The minimum supported version is now 1.51.0.
v0.3.2
Compare Source
Added
Instant
is now#[repr(transparent)]
Fixed
Date
from its ISO year, week, and weekday now returns the correct value in allcircumstances. 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 thedate!
macro.v0.3.1
Compare Source
Changed
serde-well-known
feature flag is deprecated. The necessary features for an item to beenabled are indicated in documentation.
Added
const
s can now be provided as the format description fortime::serde::format_description!
. Theconst
must be of type&[FormatItem<'_>]
, which is what is returned by thetime::macros::format_description!
macro.Compatibility
was unsupported. These flags are:
js-sys
quickcheck-dep
itoa
time-macros
v0.3.0
Compare Source
Added
datetime!
macro, which allows the construction of a statically verifiedPrimitiveDateTime
orOffsetDateTime
.PrimitiveDateTime::replace_time
PrimitiveDateTime::replace_date
OffsetDateTime::replace_time
OffsetDateTime::replace_date
OffsetDateTime::replace_date_time
OffsetDateTime::replace_offset
#![no_alloc]
supportDate::to_iso_week_date
, replacingDate::iso_year_week
Date::MIN
Date::MAX
UtcOffset::from_hms
UtcOffset::from_whole_seconds
UtcOffset::as_hms
UtcOffset::whole_hours
UtcOffset::whole_minutes
UtcOffset::minutes_past_hour
UtcOffset::seconds_past_minute
UtcOffset::is_utc
UtcOffset::is_positive
UtcOffset::is_negative
OffsetDateTime::sunday_based_week
OffsetDateTime::monday_based_week
PrimitiveDateTime::to_calendar_date
PrimitiveDateTime::to_ordinal_date
PrimitiveDateTime::to_iso_week_date
PrimitiveDateTime::to_julian_day
OffsetDateTime::to_calendar_date
OffsetDateTime::to_ordinal_date
OffsetDateTime::to_iso_week_date
OffsetDateTime::to_julian_day
Time::as_hms
Time::as_hms_milli
Time::as_hms_micro
Time::as_hms_nano
PrimitiveDateTime::as_hms
PrimitiveDateTime::as_hms_milli
PrimitiveDateTime::as_hms_micro
PrimitiveDateTime::as_hms_nano
OffsetDateTime::to_hms
OffsetDateTime::to_hms_milli
OffsetDateTime::to_hms_micro
OffsetDateTime::to_hms_nano
Duration::saturating_add
Duration::saturating_sub
Duration::saturating_mul
util::days_in_year_month
Month
Instant::into_inner
impl AsRef<StdInstant>
andimpl Borrow<StdInstant>
forInstant
user-provided flag. This functionality is not tested in any way and is not guaranteed to work.
Library authors are unable to enable this feature, as it must be passed via
RUSTFLAGS
. Furtherinformation is available in the documentation.
Changed
within the 0.3 series without being a breaking change.
macros
feature flag.OffsetDatetime::timestamp
→OffsetDateTime::unix_timestamp
OffsetDatetime::timestamp_nanos
→OffsetDateTime::unix_timestamp_nanos
Date::try_from_ymd
→Date::from_calendar_date
Date::try_from_yo
→Date::from_ordinal_date
Date::try_from_iso_ywd
→Date::from_iso_week_date
Date::as_ymd
→Date::to_calendar_date
Date::as_yo
→Date::to_ordinal_date
Date::try_with_hms
→Date::with_hms
Date::try_with_hms_milli
→Date::with_hms_milli
Date::try_with_hms_micro
→Date::with_hms_micro
Date::try_with_hms_nano
→Date::with_hms_nano
Time::try_from_hms
→Time::from_hms
Time::try_from_hms_milli
→Time::from_hms_milli
Time::try_from_hms_micro
→Time::from_hms_micro
Time::try_from_hms_nano
→Time::from_hms_nano
UtcOffset::try_local_offset_at
→UtcOffset::local_offset_at
UtcOffset::as_seconds
→UtcOffset::whole_seconds
OffsetDateTime::try_now_local
→OffsetDateTime::now_local
Date::week
→Date::iso_week
PrimitiveDateTime::week
→PrimitiveDateTime::iso_week
OffsetDateTime::week
→OffsetDateTime::iso_week
Date::julian_day
→Date::to_julian_day
Duration
unit values, as well as the minimum and maximum, are now associated constants.OffsetDateTime::unix_epoch()
→OffsetDateTime::UNIX_EPOCH
Time::midnight()
→Time::MIDNIGHT
const fn
(on at least newer compilers)Date::weekday
Date::next_day
Date::previous_day
PrimitiveDateTime::assume_offset
PrimitiveDateTime::weekday
Duration::checked_add
Duration::checked_sub
Duration::checked_mul
OffsetDateTime::from_unix_timestamp
OffsetDateTime::from_unix_timestamp_nanos
OffsetDateTime::date
OffsetDateTime::time
OffsetDateTime::year
OffsetDateTime::month
OffsetDateTime::day
OffsetDateTime::ordinal
OffsetDateTime::to_iso_week_date
OffsetDateTime::week
OffsetDateTime::weekday
OffsetDateTime::hour
OffsetDateTime::minute
OffsetDateTime::second
OffsetDateTime::millisecond
OffsetDateTime::microsecond
OffsetDateTime::nanosecond
OffsetDateTime::unix_timestamp
OffsetDateTime::unix_timestamp_nanos
Result
:Date::from_julian_day
OffsetDateTime::from_unix_timestamp
OffsetDateTime::from_unix_timestamp_nanos
Option
:Date::next_day
Date::previous_day
large-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_at
OffsetDateTime::now_local
Instant
is now guaranteed to be represented as a tuple struct containing astd::time::Instant
.Date::to_julian_day
now returns ani32
(wasi64
).Date::from_julian_day
now accepts ani32
(wasi64
).be used with value literals, the breakage caused by this should be minimal.
Month
enum is used instead of numerical values where appropriate.Removed
PreciseTime
SteadyTime
precise_time_ns
precise_time_s
Instant::to
Duration::num_weeks
Duration::num_days
Duration::num_hours
Duration::num_minutes
Duration::num_seconds
Duration::num_milliseconds
Duration::num_microseconds
Duration::num_nanoseconds
Duration::span
Duration::from_std
Duration::to_std
Date::from_ymd
Date::from_yo
Date::from_iso_ywd
Date::with_hms
Date::with_hms_milli
Date::with_hms_micro
Date::with_hms_nano
Time::from_hms
Time::from_hms_milli
Time::from_hms_micro
Time::from_hms_nano
Date::today
Time::now
PrimitiveDateTime::now
PrimitiveDateTime::unix_epoch
PrimitiveDateTime::from_unix_timestamp
PrimitiveDateTime::timestamp
OffsetDateTime::now
impl Sub<SystemTime> for PrimitiveDateTime
impl Sub<PrimitiveDateTime> for SystemTime
impl PartialEq<SystemTime> for PrimitiveDateTime
impl PartialEq<PrimitiveDateTime> for SystemTime
impl PartialOrd<SystemTime> for PrimitiveDateTime
impl PartialOrd<PrimitiveDateTime> for SystemTime
impl From<SystemTime> for PrimitiveDateTime
impl From<PrimitiveDateTime> for SystemTime
UtcOffset::local_offset_at
— assumed UTC if unable to determine local offsetOffsetDateTime::now_local
— assumed UTC if unable to determine local offsetDuration::sign
PrimitiveDateTime::using_offset
Sign
days_in_year
is_leap_year
validate_format_string
weeks_in_year
ComponentRangeError
ConversionRangeError
IndeterminateOffsetError
ParseError
NumericalDuration
NumericalStdDuration
NumericalStdDurationShort
fmt::Error
, indicatingan error unrelated to the time crate.
Time::lazy_format
Date::lazy_format
UtcOffset::lazy_format
PrimitiveDateTime::lazy_format
OffsetDateTime::lazy_format
prelude
module has been removed in its entirety.Date::iso_year_week
in favor ofDate::to_iso_week_date
PrimitiveDateTime::iso_year_week
OffsetDateTime::iso_year_week
UtcOffset::east_hours
UtcOffset::west_hours
UtcOffset::hours
UtcOffset::east_minutes
UtcOffset::west_minutes
UtcOffset::minutes
UtcOffset::east_seconds
UtcOffset::west_seconds
UtcOffset::seconds
Date::month_day
PrimitiveDateTime::month_day
OffsetDateTime::month_day
Weekday::iso_weekday_number
(identical toWeekday::number_from_monday
)ext::NumericalStdDurationShort
v0.2.27
Compare Source
v0.2.26
Compare Source
Fixed
v0.2.25
Compare Source
Fixed
v0.2.24
Compare Source
Fixed
OffsetDateTime::timestamp
,OffsetDateTime::unix_timestamp
,PrimitiveDatetime::timestamp
, andOffsetDateTime::unix_timestamp
have been corrected. Thisaffects all negative timestamps with a nonzero subsecond value.
v0.2.23
Compare Source
Compatibility notes
Due to #293, any method that requires knowledge of the local offset will now
fail on Linux. For
try_
methods, this means returning an error. For others,it means assuming UTC.
Deprecated
UtcOffset::timestamp
(moved toUtcOffset::unix_timestamp
)UtcOffset::timestamp_nanos
(moved toUtcOffset::unix_timestamp_nanos
)date
(moved tomacros::date
)time
(moved tomacros::time
)offset
(moved tomacros::offset
)OffsetDateTime::now_local
(assumes UTC if unable to be determined)UtcOffset::local_offset_at
(assumes UTC if unable to be determined)UtcOffset::current_local_offset
(assumes UTC if unable to be determined)v0.2.22
Compare Source
Fixed
Duration::new
could previously result in an inconsistent internal state. This led to some oddsituations where a
Duration
could be both positive and negative. This has been fixed such thatthe internal state maintains its invariants.
v0.2.21
Compare Source
Changed
component being out of range can be directly obtained, while an invalid offset or conversion error
is guaranteed to be a zero-sized type.
const fn
on rustc ≥ 1.46:Date::try_from_iso_ywd
Date::iso_year_week
Date::week
Date::sunday_based_week
Date::monday_based_week
Date::try_with_hms
Date::try_with_hms_milli
Date::try_with_hms_micro
Date::try_with_hms_nano
PrimitiveDateTime::iso_year_week
PrimitiveDateTime::week
PrimitiveDateTime::sunday_based_week
PrimitiveDateTime::monday_based_week
util::weeks_in_year
v0.2.20
Compare Source
Added
OffsetDateTime::timestamp_nanos
OffsetDateTime::from_unix_timestamp_nanos
Fixed
A bug with far-reaching consequences has been fixed. See #276 for complete details, but the gist is
that the constructing a
Date
from a valid Julian day may result in an invalid value or even panic.As a consequence of implementation details, this affects nearly all arithmetic with
Date
s (and asa result also
PrimitiveDateTime
s andOffsetDateTime
s).Improvements
OffsetDateTime
from a timestamp-nanosecond pairv0.2.19
Compare Source
Fixed
COMPILING_UNDER_CARGO_WEB
environmentvariable.
%D
specifier no longer requires padding on the month. Previously,Err(InvalidMonth)
was incorrectly returned.std::time::Duration
that is larger thantime::Duration::max_value()
now correctly returnsOrdering::Greater
when compared.Sign::Zero
now sets the integer to be zero. Thispreviously left the integer unmodified.
v0.2.18
Compare Source
Changed
const fn
on rustc ≥ 1.46:Date::try_from_ymd
Date::try_from_yo
Time::try_from_hms
Time::try_from_hms_milli
Time::try_from_hms_micro
Time::try_from_hms_nano
error
module has been created where all existing error types are contained. TheError
suffix has been dropped from these types.
ext
module has been created where extension traits are contained.util
module has been created where utility functions are contained.error::ComponentRange
now implementsCopy
.For back-compatibility, all items that were moved to newly-contained modules have been re-exported
from their previous locations (and in the case of the
error
module, with their previous name).Fixes
Parsing
format::Rfc3339
now correctly handles the UTC offset (#274).v0.2.17
Compare Source
Changed
The following functions are
const fn
on rustc ≥ 1.46:Date::year
Date::month
Date::day
Date::month_day
Date::ordinal
Date::as_ymd
Date::as_yo
Date::julian_day
Duration::checked_div
PrimitiveDateTime::year
PrimitiveDateTime::month
PrimitiveDateTime::day
PrimitiveDateTime::month_day
PrimitiveDateTime::ordinal
Weekday::previous
Weekday::next
Improvements
size_of::<Date>()
has been reduced from 8 to 4. As a consequence,size_of::<PrimitiveDatetime>()
went from 16 to 12 andsize_of::<OffsetDateTime>()
from 20to 16. This change also results in a performance improvement of approximately 30% on the
Date::year
andDate::ordinal
methods.cfg-if
has been removed as a dependency.Fixed
cfg
flags passed to rustc will no longer collide with other crates (at least unless they'redoing something very stupid).
combinations would fail.
v0.2.16
Compare Source
Added
OffsetDateTime
s can now be represented as Unix timestamps with serde. To do this, you can use thetime::serde::timestamp
andtime::serde::timestamp::option
modules.v0.2.15
Compare Source
Fixed
cargo-web
support works, and is now explicitly checked in CI. A previous change was made that madea method call ambiguous.
v0.2.14
Compare Source
Fixed
Adding/subtracting a
core::time::Duration
now correctly takes subsecond values into account. Thisalso affects
PrimitiveDateTime
andOffsetDateTime
.v0.2.13
Compare Source
Fixed
Panicking APIs are re-exposed.
v0.2.12
Compare Source
Fixed
Subtracting
Instant
s can correctly result in a negative duration, rather than resulting in theabsolute value of it.
v0.2.11
Compare Source
Added
OffsetDateTime::now_utc
Deprecated
OffsetDateTime::now
due to the offset not being clear from the method name alone.Fixed
Date
s are now uniformly random when using therand
crate. Previously, both the year and daywithin the year were uniform, but this meant that any given day in a leap year was slightly less
likely to be chosen than a day in a non-leap year.
Changed
v0.2.10
Compare Source
Added
OffsetDateTime
s as RFC3339.impl Display
, rather than a concrete type.Fixed
v0.2.9
Compare Source
Fixed
cfg-if
now has a mandatory minimum of 0.1.10, rather than just 0.1. This is because compilationfails when using 0.1.9.
v0.2.8
Compare Source
Added
cargo_web
support has been added for getting a local offset. A general catch-all defaulting toUTC has also been added.
Error::source
has been implemented for the wrappertime::Error
.UtcOffset::try_local_offset
,UtcOffset::try_current_local_offset
,OffsetDateTime::try_now_local()
provide fallible alternatives when the default of UTC is notdesired. To facilitate this change,
IndeterminateOffsetError
has been added.Changed
#[non_exhaustive]
is simulated on compilers prior to 1.40.0.v0.2.7
Compare Source
Added
Display
has been implemented forDate
,OffsetDateTime
,PrimitiveDateTime
,Time
,UtcOffset
, andWeekday
.Hash
is now derived forDuration
.SystemTime
can be converted to and fromOffsetDateTime
. The following trait implementationshave been made for interoperability:
impl Sub<SystemTime> for OffsetDateTime
impl Sub<OffsetDateTime> for SystemTime
impl PartialEq<SystemTime> for OffsetDateTime
impl PartialEq<OffsetDateTime> for SystemTime
impl PartialOrd<SystemTime> for OffsetDateTime
impl PartialOrd<OffsetDateTime> for SystemTime
impl From<SystemTime> for OffsetDateTime
impl From<OffsetDateTime> for SystemTime
impl Duration<T> for Standard
, allowing usage with therand
crate. This isgated behind the
rand
feature flag.NumericalDuration
has been implemented forf32
andf64
.NumericalStdDuration
andNumericalStdDurationShort
have been implemented forf64
only.UtcOffset::local_offset_at(OffsetDateTime)
, which will obtain the system's local offset at theprovided moment in time.
OffsetDateTime::now_local()
is equivalent to callingOffsetDateTime::now().to_offset(UtcOffset::local_offset_at(OffsetDateTime::now()))
(but moreefficient).
UtcOffset::current_local_offset()
will return the equivalent ofOffsetDateTime::now_local().offset()
.Changed
impl AsRef<str>
as parameters, rather than just&str
.time::validate_format_string
does this as well.Date
being between the years -100,000 and +100,000 (inclusive) is nowstrictly enforced.
Duration
are now enabled by default. This behavior is the identical to whatthe standard library does.
time
,date
, andoffset
macros have been added to the prelude.Deprecated
Sign
has been deprecated in its entirety, along withDuration::sign
.To obtain the sign of a
Duration
, you can use theDuration::is_positive
,Duration::is_negative
, andDuration::is_zero
methods.A number of functions and trait implementations that implicitly assumed a timezone (generally UTC)
have been deprecated. These are:
Date::today
Time::now
PrimitiveDateTime::now
PrimitiveDateTime::unix_epoch
PrimitiveDateTime::from_unix_timestamp
PrimitiveDateTime::timestamp
impl Sub<SystemTime> for PrimitiveDateTime
impl Sub<PrimitiveDateTime> for SystemTime
impl PartialEq<SystemTime> for PrimitiveDateTime
impl PartialEq<PrimitiveDateTime> for SystemTime>
impl PartialOrd<SystemTime> for PrimitiveDateTime
impl PartialOrd<PrimitiveDateTime> for SystemTime>
impl From<SystemTime> for PrimitiveDateTime
impl From<PrimitiveDateTime> for SystemTime
Fixed
Duration
is now always in range. Previously, it was possible (viaaddition and/or subtraction) to obtain a value that was not internally consistent.
Time::parse
erroneously returned anInvalidMinute
error when it was actually the second thatwas invalid.
Date::parse("0000-01-01", "%Y-%m-%d")
incorrectly returned anErr
(#221).v0.2.6
Compare Source
Bug fixes
v0.2.5 introduces a major inconsistency, not just in its behavior for
PrimitiveDateTime::using_offset
, but also changes its signature, rendering it incapable of being used inconst
contexts.Both the behavior and the function signature have been fixed, while still fixing the underlying issue.
PrimitiveDateTime::using_offset
mentions in the docs that thePrimitiveDateTime
is assumed to be UTC, and is converted to the provided offset. This was the previous behavior.The following functionality had bugs that were fixed (from v0.2.4):
OffsetDateTime::timestamp
OffsetDateTime::parse
OffsetDateTime
— Subsecond values were not checked previously. They also relied on the faulty timestamp implementation.OffsetDateTime
— Same as equality and comparison. Additionally, hashes would collide withPrimitiveDateTime
if the underlying UTC was the same.OffsetDateTime
s previously disregarded the subsecond values.All of these changes are now checked in CI, so regressions will be caught.
v0.2.5
Compare Source
Bug fixes
PrimitiveDateTime::using_offset
was poorly defined, leading to an ambiguity that cause some methods to treat the existing datetime as UTC, while others treated it as the time in the provided offset. This release ensures that the behavior is what I intended — the datetime is assumed to be in the provided offset.NB: This release has been yanked from crates.io due to major back-compatibility issues. These have been fixed in 0.2.6.
v0.2.4
Compare Source
v0.2.4 is identical to v0.2.3 with the exception of the breaking change, which has been reverted. v0.2.4 is backwards-compatible with v0.2.2.
v0.2.3
Compare Source
v0.2.3 has been yanked from crates.io. The breaking change (with regard to feature flags) should not have been made. By yanking this version, any existing code will continue to work, while new code will not have potential backwards-incompatible behavior. The change was reverted in v0.2.4.
Additions
time!
,date!
,offset!
macrosparse
function, allowing for type inference.time::Result<T>
alias totime::Result<T, time::Error>
Deprecated
Panicking APIs have been deprecated in favor of the new macros.
Changes
Minimum supported Rust version is now 1.34, changed from 1.40. This permits a number of crates to upgrade without breaking MSRV.
Bug fixes
A number of parsing methods used unchecked constructors. This was because the values should have been checked prior. They are now.
Breaking changes
The "std" feature has been renamed to "alloc", which disables the standard library. This was necessary to bring MSRV down to 1.34.
v0.2.2
Compare Source
Fixed
v0.2.1
Compare Source
Fixed
COMPILING_UNDER_CARGO_WEB
environmentvariable.
%D
specifier no longer requires padding on the month. Previously,Err(InvalidMonth)
was incorrectly returned.std::time::Duration
that is larger thantime::Duration::max_value()
now correctly returnsOrdering::Greater
when compared.Sign::Zero
now sets the integer to be zero. Thispreviously left the integer unmodified.
Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.
Update Rust crate time to 0.3to Update Rust crate time to 0.3 - autoclosedPull request closed