What is the oldest time that can be represented in Python?

前端 未结 5 925
耶瑟儿~
耶瑟儿~ 2021-02-06 21:40

I have written a function comp(time1, time2) which will return True when time1 is less than time2. I have a scenario where

5条回答
  •  终归单人心
    2021-02-06 21:57

    In python, the datetime object exports the following constants

    datetime.MINYEAR
    The smallest year number allowed in a date or datetime object. MINYEAR is 1.
    
    datetime.MAXYEAR
    The largest year number allowed in a date or datetime object. MAXYEAR is 9999.
    

    http://docs.python.org/library/datetime.html

提交回复
热议问题