In the code below I want to acquire the timezone of a pandas Timestamp supplied to a function:
import pandas as pd
import pytz
timestamp = pd.Timestamp("2022-05-01", tz='Europe/Paris')
print(timestamp.tzinfo)
This prints:
Europe/Paris
However, I would like to check whether the timezone matches the timezone that I want and return a boolean value, such as:
timestamp.tzinfo == 'Europe/Paris'
But this returns False. Is there anyone here who knows a clever of checking the timezone of a timezone aware pandas Timestamp?