timex v3.0.0 Release Notes

  • IMPORTANT: This release is a significant rewrite of Timex's internals as well as API. Many things have remained unchanged, ๐Ÿ—„ but there are many things that have as well. Mostly the removal of prior deprecations, and the removal (without deprecation) of things incompatible with, or now redundant due to, the introduction of calendar types in Elixir 1.3 and their impact on Timex. The list of these changes will be comprehensively spelled out below, along with recommendations for alternatives in the cases of removals.

    ๐Ÿ›  Fixed

    โž• Added

    • Timex.Protocol (defines the API all calendar types must implement to be used with Timex)
    • compare/3, diff/3 shift/2, now allow the use of :milliseconds and :microseconds
    • set/2 now allow the use of :microsecond
    • Timex.Duration
    • to_gregorian_microseconds/1, converts a date/time value to microseconds since year zero

    ๐Ÿ”„ Changed

    • Timex's old Date/DateTime types are replaced by Elixir 1.3's new calendar types, NaiveDateTime is now used where appropriate, and AmbiguousDateTime remains in order to handle timezone ambiguities.
    • Timex.diff/3 now returns to it's old behaviour of returning a signed integer for values, so that diffing/comparing can be done on a single value.
    • ๐Ÿ“‡ Renamed Timex.Time to Timex.Duration to better reflect it's purpose and prevent conflicts with Elixir's built-in Time type.
    • Renamed Timex.Format.Time.* to Timex.Format.Duration.*
    • ๐Ÿ“‡ Renamed :timestamp options to :duration
    • Renamed *_timestamp functions to *_duration
    • ๐Ÿ”„ Changed Timex.Duration to operate on and return Duration structs rather than Erlang timestamp tuples
    • ๐Ÿ”„ Changed Duration.from/2, to Duration.from_*/1, moving the unit into the name.
    • Renamed to_erlang_datetime to to_erl

    โœ‚ Removed

    • Timex.Date (use Timex now)
    • Timex.DateTime (use Timex now)
    • Timex.Convertable (no longer makes sense in the face of differentiating NaiveDateTime/DateTime)
    • set/2 no longer allow the use of :millisecond
    • โœ‚ Removed Timex.date
    • ๐Ÿ—„ Deprecated Timex.datetime
    • โœ‚ Removed from_timestamp functions
    • โœ‚ Removed to_gregorian
    • Removed to_seconds/2 in favor of to_gregorian_seconds/1 and to_unix/1
    • โœ‚ Removed normalize/1, it no longer is necessary. normalize/2 still exists however