Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8782087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:28:34+00:00 2026-06-13T20:28:34+00:00

What is happening here? This expected: >>> datetime.min – timedelta(days=1) Traceback (most recent call

  • 0

What is happening here?

This expected:

>>> datetime.min - timedelta(days=1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: date value out of range

Unexpected:

>>> datetime.min - timedelta(days=2)
datetime.datetime(1, 0, 255, 0, 0)

>>> datetime.min > (datetime.min - timedelta(days=2))
True

In python, what do these values mean when you subtract from datetime.min? What dates do they represent? Why do some cases not trigger an OverflowError?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:28:36+00:00Added an answer on June 13, 2026 at 8:28 pm

    Because you need to upgrade to Python 2.6 or later, which fixed this bug.

    $ python2.5 -c 'import datetime; print(datetime.datetime.min - datetime.timedelta(days=2))'
    0001-00-255 00:00:00
    $ python2.6 -c 'import datetime; print(datetime.datetime.min - datetime.timedelta(days=2))'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    OverflowError: date value out of range
    $ python2.7 -c 'import datetime; print(datetime.datetime.min - datetime.timedelta(days=2))'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    OverflowError: date value out of range
    $ python3.3 -c 'import datetime; print(datetime.datetime.min - datetime.timedelta(days=2))'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    OverflowError: date value out of range
    

    Do you need someone to track down the bug number, patch, and python-dev discussion, or is that enough information for you?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(LocalVariable)ABC.string(Name) = (IDataReader)dataReader.GetString(0); This name value is coming from database. What happening here is
This is a bit of an odd situation. Here's what's happening. So, we have
This is my first experience with javascript, and... Well... Ugh. Here's what's happening: function
I can't capture what is happening here. My global.asax file has nothing exotic in
Weird stuff happening here. See this tinkerbin page, if you may: http://tinkerbin.com/UZy6H6q4 Here's the
What's happening here : $ echo $SHELL /bin/bash $ echo -e foo foo $
I don't know what's happening here: #include<stdio.h> int main() { int i, j, *k,
I am not exactly sure what's happening here - I open a terminal window
I don't understand what's happening here. If someone could explain, I would appreciate it.
Can anyone tell me what is happening here? <?php // true var_dump('\\ ' ===

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.