Datetime

Latest version: v5.5

Safety actively analyzes 681844 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 7

3.0b1

------------------

- Restored `strftimeFormatter` as a class.

- Added tests for read-only class attributes and interface.

3.0a2

------------------

- Added back support for reading old DateTime pickles without a `_micros` value.

- Avoid storing `_t` representing the time as a float in seconds since the
epoch, as we already have `_micros` doing the same as a long. Memory use is
down to about 300 bytes per DateTime instance.

- Updated exception raising syntax to current style.

- Avoid storing `_aday`, `_fday`, `_pday`, `_amon`, `_fmon`, `_pmon`, `_pmhour`
and `_pm` in memory for every instance but look them up dynamically based on
`_dayoffset`, `_month` and `_hour`. This saves another 150 bytes of memory
per DateTime instance.

- Moved various internal parsing related class variables to module constants.

- No longer provide the `DateError`, `DateTimeError`, `SyntaxError` and
`TimeError` exceptions as class attributes, import them from their canonical
`DateTime.interfaces` location instead.

- Removed deprecated `_isDST` and `_localzone` class variables.

- Moved pytz cache from `DateTime._tzinfo` to a module global `_TZINFO`.

- Make DateTime a new-style class and limit its available attributes via a
slots definition. The pickle size increases to 110 bytes thanks to the
`ccopy_reg\n_reconstructor` stanza. But the memory size drops from 3kb to
500 bytes for each instance.

3.0a1

------------------

- Reordered some calculations in `_calcIndependentSecondEtc` to preserve more
floating point precision.

- Optimized the pickled data, by only storing a tuple of `_micros` and time
zone information - this reduces the pickle size from an average of 300 bytes
to just 60 bytes.

- Optimized un-pickling, by avoiding the creation of an intermediate DateTime
value representing the current time.

- Removed in-place migration of old DateTime pickles without a `_micros` value.

- Removed deprecated support for using `DateTime.__cmp__`.

- Take time zone settings into account when comparing two date times for
(non-) equality.

- Fixed (possibly unused) _parse_iso8601 function.

- Removed unused import of legacy DateTimeZone, strftime and re.
Remove trailing whitespace.

- Removed reference to missing version section from buildout.

2.12.7

-------------------

- Added forward compatibility with DateTime 3 pickle format. DateTime
instances constructed under version 3 can be read and unpickled by this
version. The pickled data is converted to the current versions format
(old-style class / no slots). Once converted it will be stored again in the
old format. This should allow for a transparent upgrade/downgrade path
between DateTime 2 and 3.

2.12.6

-------------------

- Changed ``testDayOfWeek`` test to be independent of OS locale.

2.12.5

-------------------

- Launchpad 143269: Corrected the documentation for year value
behavior when constructing a DateTime object with three numeric
arguments.

- Launchpad 142521: Removed confusing special case in
DateTime.__str__ where DateTime instances for midnight
(e.g. '2010-07-27 00:00:00 US/Eastern') values would
render only their date and nothing else.

Page 5 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.