scrapinghub / scrapinghub/dateparser

Timezones support is deficient

Open
#683 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Enhancement
Dominant language
Python
Stars
2.9k
Forks
520
Avg merge
22h 56m
Merged PRs (30d)
6

Description

I think we should rethink how the timezones are applied, as we have more than one case of abbreviations with different meanings.

I could found at least these cases:

I'm not sure about the solution we could implement, but it's obvious that we can not choose a timezone randomly.

Some ideas:

  • We could choose the most used, for example, we could maybe change IST from "Israel Standard Time" (current) to "Indian Standard Time" (hard to decide, not a solution itself).
  • We could add a warning when parsing timezones with more than one meaning (self-explanatory, but not a solution and it could be a problem when people already know it, as it could spam with a lot of warning messages).
  • We could add a setting like "PREFER_TIMEZONE_FROM" or something similar where users can specify if they prefer timezones from a continent or another negative vs positive timezones (I'm not sure about this, as there are some examples in the list (like CDT or ECT) where all the timezones are from the same continent/region).
  • We could add a setting that would allow specifying preferent manual timezones (example: TIMEZONES_EQUIVALENT = {'IST': '+5.30'}). (possible solution but a hard to discover behavior).
  • We could implement some of the above ideas together.

On the other side, we should think about how we could implement more timezones formats like 'Australia/Sydney': https://github.com/scrapinghub/dateparser/issues/298

Please, if you have any idea add a comment here below 👇 Any idea will be welcomed!!!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name specific files, tests, or entry points; start by locating the timezone-abbreviation handling and reviewing the related issues and pull requests linked in the report. Done would require an agreed disambiguation strategy, support for the requested timezone formats, and tests covering the listed conflicting abbreviations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.