[ python-Bugs-1569623 ] datetime.datetime subtraction bug

SourceForge.net noreply at sourceforge.net
Tue Oct 3 01:16:35 CEST 2006


Bugs item #1569623, was opened at 2006-10-02 23:16
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1569623&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Extension Modules
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: David Fugate (dfugate_ms)
Assigned to: Nobody/Anonymous (nobody)
Summary: datetime.datetime subtraction bug

Initial Comment:
Python version: 2.5
OS name and version: Windows XP SP2
Email: dfugate at microsoft.com

The datetime.datetime subtraction operator seems to
have a bug in it:

Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC
v.1310 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for
more information.
>>> import datetime
>>> x = datetime.datetime(2006, 9, 29, 15, 37, 28, 686001)
>>> y = datetime.datetime(2006, 9, 29, 15, 37, 28, 686000)
>>> x - y
datetime.timedelta(0, 0, 1)
>>> y - x
datetime.timedelta(-1, 86399, 999999)

Here, the result of y - x should be timedelta(0, 0, -1).

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1569623&group_id=5470


More information about the Python-bugs-list mailing list