scrapinghub / scrapinghub/dateparser
The UTC time for different locations in search_dates
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 520
- Avg merge
- 22h 56m
- Merged PRs (30d)
- 6
Description
I am using seach_dates in dateparser.search to extract dates and times.
I am using this script to get the datetime.
PARSED_DATES_SETTINGS = {'DEFAULT_LANGUAGES': ["en"],
"TO_TIMEZONE": "UTC",
"PREFER_DATES_FROM": "future",
"SKIP_TOKENS": ['time', 'per', 'sam', 'or', 'any', 'no', 'at', 'set', 'sec', 'man', 'to', 'did', 'her', 'api', 'be', 'are', 'see', 'more', 'can', 'out', 'a', 'now', 'do', 'so', 'on', '1:1', 'second','seconds', 'minute','minutes', 'me', 'an', 'am'],
}
text="call me next tuesday"
dt=search_dates(text=text,settings=PARSED_DATES_SETTINGS)[0][1]
dt
When the time information is not present in the text, it is giving the UTC time as 18:30. But, I would expect it to give time as 00:00 since time is not present.
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 with the reported search_dates call in dateparser.search and reproduce it using the provided PARSED_DATES_SETTINGS and “call me next tuesday” input. Trace how a missing time is converted when TO_TIMEZONE is UTC. Done means text without time information returns 00:00 rather than 18:30, while preserving the expected timezone behavior.
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
- 42/100