-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
timezone issues with show name in past
CRIDs
#244
Comments
this is the minimal reproducer for radiorabe/suisa_sendemeldung#528 import cridlib
from datetime import datetime
import pytz
timestamp_utc = pytz.utc.localize(
datetime.strptime("2024-01-16 23:01:16", "%Y-%m-%d %H:%M:%S"),
)
crid = cridlib.get(timestamp=timestamp_utc)
print(crid)
assert "klangbecken" in str(crid) |
The consumer needs to tell CRIDlib where we are: import cridlib
from datetime import datetime
import pytz
timestamp_utc = pytz.utc.localize(
datetime.strptime("2024-01-16 23:01:16", "%Y-%m-%d %H:%M:%S"),
)
crid = cridlib.get(timestamp=timestamp_utc.astimezone(pytz.timezone("Europe/Zurich")))
print(crid)
assert "klangbecken" in str(crid) Maybe CRIDlib should |
DoD (both with and w/o import cridlib
from datetime import datetime
import pytz
timestamp_utc = pytz.utc.localize(
datetime.strptime("2024-01-16 23:01:16", "%Y-%m-%d %H:%M:%S"),
)
crid = cridlib.get(timestamp=timestamp_utc)
assert "crid://rabe.ch/v1/klangbecken#t=clock=20240116T230116.00Z" == str(crid)
timestamp = pytz.utc.localize(
datetime.strptime("2024-01-16 23:01:16", "%Y-%m-%d %H:%M:%S"),
).astimezone(pytz.timezone("Europe/Zurich"))
crid2 = cridlib.get(timestamp=timestamp)
assert "crid://rabe.ch/v1/klangbecken#t=clock=20240116T230116.00Z" == str(crid2) |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Depending on CEST/CET, the show name doesn't match. There is a bunch of timezone related code involved, and due to several historic implementations there is a lot of converting going on that should be looked into.
The text was updated successfully, but these errors were encountered: