Changelog#
v2.0.1 (2023-11-20)#
Add support for Python 3.12
Replace usage of deprecated
datetime.utcnowanddatetime.utcfromtimestamp.
v2.0.0 (2021-06-26)#
Drop support for Python 3.4 and 3.5.
v1.3.1 (2021-06-26)#
Fix compatibility issue with Python 3.4 and 3.5 by replacing f-string usage with string-format.
v1.3.0 (2021-01-07)#
Add Python 3.9 support.
Fix bug in
Zulu.time_from,Zulu.time_to,Zulu.time_from_now, andZulu.time_to_nowwhere keyword arguments weren’t passed to underlyingDelta.formatcall.Fix bug in
Zulu.formatwhere “YY” and “YYYY” format patterns would return the year in “Week of Year” based calendars instead of the regular calendar year.
v1.2.0 (2020-01-14)#
Add Python 3.8 support.
Add
'week'option toZulu.start_of,Zulu.end_of,Zulu.span, andZulu.span_range. Thanks ThomasChiroux!Fix bug in
Zulu.astimezonein Python 3.8 due to change in return type fromsuper().asdatetime. In Python<=3.7,super().asdatetimereturned as instance ofdatetime, but in Python 3.8 another instance ofZuluwas returned instead.Zulu.astimezonewill now return adatetimeinstance in Python 3.8.
v1.1.1 (2019-08-14)#
Remove unused parameter in
zulu.Timer.__init__().
v1.1.0 (2018-11-01)#
Add
foldattribute support toZulu.Add
zulu.to_secondsfor converting units of time to total number of seconds.Add
zulu.Timerclass that can be used to track elapsed time (like a stopwatch) or as a countdown timer.
v1.0.0 (2018-08-20)#
Drop support for Python 2.7.
v0.12.1 (2018-07-16)#
Support Python 3.7.
v0.12.0 (2017-07-11)#
Add
Zulu.datetimetuple().Add
Zulu.datetuple().Remove
Zulu.__iter__method. (breaking change)Remove
Delta.__iter__method. (breaking change)
v0.11.0 (2017-06-28)#
Add Python 3.6 support.
Add
Delta.__iter__method that yields 2-element tuples likeZulu.__iter__. Delta values are normalized into integer values distributed from the higher units to the lower units.Add
Delta.__float__andDelta.__int__methods for converting to seconds.Add
Zulu.__float__andZulu.__int__methods for converting to epoch seconds.Fix issue in Python 3.6 where
zulu.now()returned a naive datetimeZuluinstance.Make
Zulu.__iter__yield 2-element tuples containing(unit, value)like(('year', 2000), ('month', 12), ...)so it can be converted to adictwith proper keys easier. (breaking change)Remove previously deprecated
zulu.delta()function. Usezulu.parse_delta()instead. (breaking change)Rename modules: (breaking change)
zulu.datetime -> zulu.zuluzulu.timedelta -> zulu.delta
v0.10.1 (2017-02-15)#
Provide fallback for the default value of
localeinDelta.format()when a locale is not known via environment variables.
v0.10.0 (2017-02-13)#
Add
zulu.parse_deltaas alias forDelta.parse.Deprecate
zulu.deltain favor ofzulu.parse_delta.Allow first argument to
Zulu(),Zulu.parse(), andzulu.parse()to be adictcontaining keys corresponding to initialization parameters.Fix error message for invalid timezone strings so that the supplied string is shown correctly.
v0.9.0 (2016-11-21)#
Require
python-dateutil>=2.6.0. (breaking change)Replace usage of
pytztimezone handling for strings withdateutil.tz.gettz. Continue to supportpytztimezones duringZulu()object creation. (breaking change).Replace default UTC timezone with
dateutil.tz.tzutc(). Was previouslypytz.UTC. (breaking change)Replace local timezone with
dateutil.tz.tzlocal(). Was previously set by thetzlocallibrary. (breaking change)
v0.8.0 (2016-10-31)#
Add comparison methods to
Zulu:is_beforeis_on_or_beforeis_afteris_on_or_afteris_between
v0.7.3 (2016-10-24)#
Optimize
Zulu()constructor by eliminating multiple unnecessary calls todatetimeconstructor.
v0.7.2 (2016-09-06)#
Fix
Zulunot being pickle-able.
v0.7.1 (2016-08-22)#
Add missing magic method overrides for
Deltafor+delta,-delta, andabs(delta)so thatDeltais returned instead ofdatetime.timedelta.__pos____neg____abs__
v0.7.0 (2016-08-22)#
Make
Zulu.__sub__andZulu.subtractreturn aDeltaobject instead ofdatetime.timedelta.Make
zulu.deltaandZulu.Delta.parseaccept a number.Allow the first argument to
Zulu.shiftbe a timedelta or relative delta object.Ensure that mathematical magic methods for
DeltareturnDeltaobjects and notdatetime.timedelta.__add____radd____sub____mul____rmul____floordiv____truediv__(Python 3 only)__div__(Python 2 only)__mod__(Python 3 only)__divmod__(Python 3 only)
v0.6.0 (2016-08-14)#
Replace internal implementation of Unicode date pattern formatting with Babel’s
format_datetime. breaking changeRemove support for formatting to timestamp using
XandXX. breaking changeRename parse-from-timestamp token from
Xtotimestamp. breaking changeAdd
zulu.createas factory function to create azulu.Zuluinstance.Add locale support to
Zulu.formatwhen using Unicode date pattern format tokens.Restore locale support to
Delta.format.
v0.5.0 (2016-08-13)#
Remove locale support from
Delta.format. Locale is currently not supported inZulu.formatso decided to disable it inDelta.formatuntil both can have it. breaking change
v0.4.0 (2016-08-13)#
Rename
zulu.DateTimetozulu.Zulu. breaking changeRename
Zulu.isleaptoZulu.is_leap_year. breaking changeRemove
zulu.formatalias (function can be accessed atzulu.parser.format_datetime). breaking changeRemove
Zulu.leapdays. breaking changeAdd
Zulu.days_in_month.Add
zulu.Deltaclass that inherits fromdatetime.timedelta.Add
zulu.deltaas alias tozulu.Delta.parse.Add
Zulu.time_from,Zulu.time_to,Zulu.time_from_now, andZulu.time_to_nowthat return “time ago” or “time to” humanized strings.Add
zulu.rangeas alias toZulu.range.Add
zulu.span_rangeas alias toZulu.span_range.Make time units (years, months, weeks, days, hours, minutes, seconds, microseconds) keyword arguments only for
Zulu.add/subtract, but allow positional argument to be an addable/subtractable object (datetime, timedelta, dateutil.relativedelta). breaking change
v0.3.0 (2016-08-03)#
Rename
DateTime.subtoDateTime.subtract. breaking changeAllow the first argument to
DateTime.addto be adatetime.timedeltaordateutil.relativedeltaobject.Allow the first argument to
DateTime.subtractto be aDateTime,datetime.datetime,datetime.timedelta, ordateutil.relativedeltaobject.Provide
zulu.ISO8601andzulu.TIMESTAMPas parse/format constants that can be used inzulu.parse(string, zulu.ISO8601)andDateTime.format(zulu.ISO8601).Remove special parse format string
'timestamp'in favor of using just'X'as defined inzulu.TIMESTAMP. breaking changeImport
zulu.parser.formattozulu.format.Fix bug in
DateTimeaddition operation that resulted in a nativedatetimebeing returned instead ofDateTime.
v0.2.0 (2016-08-02)#
Add
DateTime.datetimeproperty that returns a native datetime.Add
DateTime.fromgmtimethat creates aDateTimefrom a UTC basedtime.struct_time.Add
DateTime.fromlocaltimethat creates aDateTimefrom a localtime.struct_time.Add
DateTime.isleapmethod that returns whether its year is a leap year.Add
DateTime.leapdaysthat calculates the number of leap days between its year and another year.Add
DateTime.start_of/end_ofand other variants that return the start of end of a time frame:start/end_of_centurystart/end_of_decadestart/end_of_yearstart/end_of_monthstart/end_of_daystart/end_of_hourstart/end_of_minutestart/end_of_second
Add
DateTime.spanthat returns the start and end of a time frame.Add
DateTime.span_rangethat returns a range of spans.Add
DateTime.rangethat returns a range of datetimes.Add
DateTime.addandDateTime.submethods.Add
yearsandmonthsarguments toDateTime.shift/add/sub.Drop support for milliseconds from
DateTime.shift/add/sub. breaking changeMake
DateTime.parse/formatunderstand a subset of Unicode date patterns.Set defaults for year (1970), month (1), and day (1) arguments to new
DateTimeobjects. Creating a newDateTimenow defaults to the start of the POSIX epoch.
v0.1.2 (2016-07-26)#
Don’t pin install requirements to a specific version; use
>=instead.
v0.1.1 (2016-07-26)#
Fix bug in
DateTime.naivethat resulted in aDateTimeobject being returned instead of a nativedatetime.
v0.1.0 (2016-07-26)#
First release.