Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7257231

Browse files
committed
Added a datetime new features entry
1 parent 3405de0 commit 7257231

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Doc/whatsnew/3.2.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,27 @@ New, Improved, and Deprecated Modules
609609
(Contributed by Raymond Hettinger and incorporating design suggestions
610610
from Mark Dickinson.)
611611

612+
.. XXX: Add a section describing new feature added to datetime module
613+
614+
* The :mod:`datetime` received several new features including
615+
616+
- A new type, :class:`timezone` that implements :class:`tzinfo`
617+
interface by returning fixed UTC offset and timezone name. This
618+
makes it easier to create aware :class:datetime` objects::
619+
620+
>>> datetime.datetime.now(datetime.timezone.utc)
621+
datetime.datetime(2010, 12, 8, 21, 4, 2, 923754, tzinfo=datetime.timezone.utc)
622+
623+
>>> datetime.datetime.strptime("01/01/2000 12:00 +0000", "%m/%d/%Y %H:%M %z")
624+
datetime.datetime(2000, 1, 1, 12, 0, tzinfo=datetime.timezone.utc)
625+
626+
(See :issue:`5094` and :issue:`6641`.)
627+
628+
- :class: timedelta objects can now be multiplied by float and
629+
divided by float and int objects.
630+
631+
(See :issue:`1289118`.)
632+
612633
* The :mod:`nntplib` module gets a revamped implementation with better bytes and
613634
unicode semantics as well as more practical APIs. These improvements break
614635
compatibility with the nntplib version in Python 3.1, which was partly

0 commit comments

Comments
 (0)