Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_rate doesnt return correct rates #122

Open
erkan612 opened this issue Dec 1, 2022 · 0 comments
Open

get_rate doesnt return correct rates #122

erkan612 opened this issue Dec 1, 2022 · 0 comments

Comments

@erkan612
Copy link

erkan612 commented Dec 1, 2022

I'm trying to get rates of a day, I need to storage them in a list by 5min perioid but the problem is, even tho it takes hour-minute-second arguments, it doesnt give me the rate from the exact hour-minute-second that i want.
Here's my example code:

from datetime import datetime
from forex_python.converter import CurrencyRates
c = CurrencyRates()
rates = []
for val in range(1):
    dt = datetime.strptime("2022-11-30 23:59:59", '%Y-%m-%d %H:%M:%S')
    rate = c.get_rate('USD', 'TRY', dt)
    rates.append(rate)


dt = datetime.strptime("2022-11-30 21:59:59", '%Y-%m-%d %H:%M:%S')
rate = c.get_rate('USD', 'TRY', dt)
rates.append(rate)
print(rates[1], "\n")
print(rates[0], "\n")

Doesn't matter which time i change, it always returns same value, which is 18.632710100231304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant