main icon indicating copy to clipboard operation
main copied to clipboard

datetime.timedelta should display more just like Cpython

Open ironpythonbot opened this issue 11 years ago • 2 comments

C:\Users\v-junche.FAREAST>ipy -X:SaveAssemblies
IronPython console: IronPython 2.0A4 (2.0.10904.02) on .NET 2.0.507
Copyright (c) Microsoft Corporation. All rights reserved.

import datetime
cls=datetime.datetime
big=cls.max-cls.min
big
datetime.timedelta(3652058, 86399, 999999)
n=(big.days _ 24 _ 3600+big.seconds) _ 1000000+big.microseconds
justasbig=datetime.timedelta(0,0,n)
justasbig
datetime.timedelta(3652059)
^Z
C:\Users\v-junche.FAREAST>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (I
32
Type "help", "copyright", "credits" or "license" for more informati
import datetime
cls=datetime.datetime
big=cls.max-cls.min
big
datetime.timedelta(3652058, 86399, 999999)
n=(big.days _ 24 _ 3600+big.seconds) _ 1000000+big.microseconds
justasbig=datetime.timedelta(0,0,n)
justasbig
datetime.timedelta(3652058, 86399, 999999)

Work Item Details

Original CodePlex Issue: Issue 23761 Status: Active Reason Closed: Unassigned Assigned to: Unassigned Reported on: Jul 27, 2009 at 11:49 PM Reported by: dfugate Updated on: Feb 22, 2013 at 2:12 AM Updated by: jdhardy Custom value: Reported internally at Microsoft. Test: test_datetime.py CreatedDate: 9/26/2007 NewInternalID: 409554 OldInternalID: 306866 AreaPath: IronPython\Modules

Plaintext Attachments

CodePlex Issue #23761 Plain Text Attachments

ironpythonbot avatar Dec 09 '14 17:12 ironpythonbot

On 2011-02-09 14:25:53 UTC, rjnienaber commented:

Current behaviour in 2.6.2 and 2.7b2 on .NET 4.0.30319.1: python27 testcase-23761.py

3652058 days, 23:59:59.999999 3652058 days, 23:59:59.999999 ipy26 testcase-23761.py

3652058 days, 23:59:59.999999 3652059 days, 0:00:00 ipy27 testcase-23761.py

3652058 days, 23:59:59.999999 3652059 days, 0:00:00

ironpythonbot avatar Dec 09 '14 17:12 ironpythonbot

Looks like we need overloads to deal with BigInteger arguments.

slozier avatar Nov 03 '16 02:11 slozier