Page MenuHomePhabricator

Implement __eq__ that does not care about timezones
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where): I want to be able to compare two times that are the same "number of seconds" but in different times.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

For example, if I have a time that's 12 AM in UTC, but 1 AM in UTC+1, I might want to know if the number of seconds are the same. The parent task has an internal method that would be helpful, but it's not exposed for __eq__() and __ne__().

Benefits (why should this be implemented?): Those two times mentioned above would occur in the same instant in time, so knowing if they are the same instant has it's uses.

Event Timeline

I think the solution is to make a new method that does this, but the question is what to name it.

Change 871017 had a related patch set uploaded (by RPI2026F1; author: RPI2026F1):

[pywikibot/core@master] [Feature] Add equal_instant()

https://gerrit.wikimedia.org/r/871017

RPI2026F1 changed the task status from Open to Stalled.Dec 23 2022, 3:38 AM
RPI2026F1 triaged this task as Low priority.

Change 871017 merged by jenkins-bot:

[pywikibot/core@master] [Feature] Add equal_instant()

https://gerrit.wikimedia.org/r/871017