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
Why are we doing second -> date conversion our selves? #2845
Well with regards to the question of strftime, I think the problem is that as far as I can tell there's nothing in the standard library that will work for dates < 1900 AD. A fix has apparently been implemented in 3.x, but is still limited to dates > 1000 AD. In my opinion, it's probably better to leave that code as is if it's working rather than add any additional dependencies.
The main other place that I see a problem is in the functions which call _from_ordinalf and _to_ordinalf, which gets the Gregorian days from datetime, then has its own method for converting fractional days into hours, minutes, seconds, etc. Again it seems like there's no library function that converts a fractional day into a timedelta, and the way it's done in dates.py is standard. See Issue 12772. Actually, I think I found a way to do this. See PR #3947.
Activity
tacaswell commentedon Feb 26, 2014
This should probably be dealt with while fixing #2294.
pganssle commentedon Dec 24, 2014
I'm not seeing exactly what you are talking about with this. Has it already been fixed?
L350 of
matplotlib.dates.pyis an indirect call to L217, which I think just deals with ordinal floats and usesdatetimepretty extensively.strftime in the current version is L434-L466, but I don't see anything obviously wrong with it.
tacaswell commentedon Dec 24, 2014
I no longer remember what prompted me to create this issue.
I think it boils down to the fact that we have all manner of logic for converting dates <-> scalars that should be handled by an external library.
Closing this as the fix is probably a complete overhaul of dates which is sort of already on the radar.
pganssle commentedon Dec 24, 2014
Well with regards to the question of
strftime, I think the problem is that as far as I can tell there's nothing in the standard library that will work for dates < 1900 AD. A fix has apparently been implemented in 3.x, but is still limited to dates > 1000 AD. In my opinion, it's probably better to leave that code as is if it's working rather than add any additional dependencies.The main other place that I see a problem is in the functions which callActually, I think I found a way to do this. See PR #3947._from_ordinalfand_to_ordinalf, which gets the Gregorian days from datetime, then has its own method for converting fractional days into hours, minutes, seconds, etc. Again it seems like there's no library function that converts a fractional day into atimedelta, and the way it's done indates.pyis standard. See Issue 12772.