You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove date limits imposed by Python's datetime module to support BC and far-future dates #26
We currently rely on Python's built-in datetime module – and its datetime and date constructs – to represent and return date/time information, but this module only supports dates between 1 and 9999 AD. The in-built Python libraries for handling date/times are simply not designed or intended for representing dates in the distant past such as any BC dates, or dates in the far future.
Currently we ignore "extreme" dates that cannot be handled by datetime by bounding recognised dates to the datetime.MINYEAR (1) and datetime.MAXYEAR (9999) boundary constants.
We will update the date parsing and processing in python-edtf to avoid this limitation by removing any use of the datetime module which imposes the limits, and will use Python's much more flexible struct_time representation when returning values that were previously returned as date or datetime objects.
While this change will make it more awkward to work with some of the API, it will allow us to better represent the real data (rather than bounding the supported date ranges) and should be relatively easy for users to convert into richer Python objects like datetimes when possible (1 AD <= year <= 9999 AD) or something like astropy.time for dates outside datetime's supported range.
WARNING: This change will cause a breaking API change for the following methods of EDTF classes which will return struct_time constructs instead of date or datetime objects:
lower_strict()
upper_strict()
lower_fuzzy()
upper_fuzzy()
or indeed any features that rely on the underlying _strict_date() methods
changed the title [-]Remove date limits imposed by Python's datetime module[/-][+]Remove date limits imposed by Python's datetime module to support BC and far-future dates[/+]on Apr 13, 2018
Activity
[-]Remove date limits imposed by Python's datetime module[/-][+]Remove date limits imposed by Python's datetime module to support BC and far-future dates[/+]#26 Remove year limitations from Pyton's datetime
#26 Fix struct_time comparisons to ignore unsupported extras
#26 Expose datetime / struct_time conversion functions
#26 Update README.md for removal of datetime limits
#26 Update changelog
#26 Make EDTFField continue to work with derived DateField
#26 Improve name and doc for 'apply_delta' function
#26 Fix import typo
#26 Fix EDTFField bug handling derived fields
#26 Add copy of library for Julian Date conversions
#26 EDTFField can now store derived dates as floats
#26 Add tests and fixes for conversion utils
#26 Rename time conversion module name from utils
#26 Add conversion functions to/from Julian Dates
#26 Correct documentation in preparation for 4.0 release
jmurty commentedon May 31, 2018
This work is now merged to master as release 4.0.0