Feature request: Report smallest interval of parsed string
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dateutil |
New
|
Undecided
|
Unassigned |
Bug Description
I need the smallest date interval that is in the parsed string.
For example, currently:
In [1]: import dateutil.parser as ps
In [2]: ps.parse(
Out[2]: datetime.
In [3]: ps.parse('5/18/1964 00:00')
Out[3]: datetime.
I need to know how detailed the string is. The datetime doesn't tell me since parsing both strings results in hour = 0 and minute = 0.
Perhaps something like
ps.functionname
'Day'
ps.functionname
'Second'
ps.functionname
'Year'
...etc.
Started looking at the code to see where I could fit this in, but thought it best to post the feature request since it might be a very easy thing to do for someone who is already familiar with the code.
It would be nice for the reported interval to be consistent with pytseries.sf.net.
Kindest regards,
Tim
Can't edit the bug report, but as I submitted found that one of my examples is incorrect.
The following:
ps.functionname ('5/18/ 1964 00:00')
'Second'
Should be:
ps.functionname ('5/18/ 1964 00:00')
'Minute'