scrapinghub / scrapinghub/dateparser
search_dates() wrong result for 12:xx am
Open
Nobody has claimed this yet.
search_dates
Type: Bug
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 520
- Avg merge
- 22h 56m
- Merged PRs (30d)
- 6
Description
search_dates() gives wrong results for times between 12:00 am and 12:59 am (hour is off by 12), but parse() is correct.
>>> import dateparser
>>> from dateparser.search import search_dates
>>> dateparser.__version__
'1.0.0'
>>>
>>> search_dates('March 3, 2021, 12:47 am')
[('March 3, 2021, 12:47 am', datetime.datetime(2021, 3, 3, 12, 47))]
>>>
>>> dateparser.parse('March 3, 2021, 12:47 am')
datetime.datetime(2021, 3, 3, 0, 47)
Python version is 3.8.9, OS is Ubuntu 20.10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported Python 3.8.9 example with search_dates('March 3, 2021, 12:47 am') and compare it with dateparser.parse(). Trace the search_dates path to find where the hour changes, then add regression coverage showing that 12:xx am remains in the midnight hour while parse() stays correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100