Skip to content

bug fix in date_to_milliseconds, which getting wrong date(not UTC-0) …#290

Open
denis-sukhoverkhov wants to merge 1 commit intosammchardy:masterfrom
denis-sukhoverkhov:master
Open

bug fix in date_to_milliseconds, which getting wrong date(not UTC-0) …#290
denis-sukhoverkhov wants to merge 1 commit intosammchardy:masterfrom
denis-sukhoverkhov:master

Conversation

@denis-sukhoverkhov
Copy link

Description of problem
I working with data from binance in utc-0. But, when i try to get some data using get_historical_klines, i pass start_str and end_str.
And inside of method date string is convert to milliseconds through date_to_milliseconds. And when i try to pass date in timestamp, like this:
klines = client.get_historical_klines("ETHBTC", Client.KLINE_INTERVAL_30MINUTE, "1 Dec, 2017", "1527300000")
where 1527300000 it is '2018-05-26 02:00' in seconds
i getting wrong set of data, where get_historical_klines getting data filtering by my timezone. This bug is only reproduced when using timestamp.
BUG FIXED
dateparser.parse(date_str, settings={'TO_TIMEZONE': 'UTC'})

…when i passed date in timestamp. I getting date with my timezone - it is wrong, because date_to_milliseconds works only with utc-0 datetime-objects.
@coveralls
Copy link

coveralls commented Jun 4, 2018

Coverage Status

Coverage remained the same at 41.272% when pulling a5de83d on denis-sukhoverkhov:master into 852b256 on sammchardy:master.

@denis-sukhoverkhov
Copy link
Author

I am not understand, how this error(python3.3) related with my code.

@kimchirichie
Copy link
Contributor

@xiaods is this irrelevant now? i will close this PR if so.

@xiaods
Copy link

xiaods commented Jan 1, 2021

@xiaods is this irrelevant now? i will close this PR if so.

need @denis-sukhoverkhov double check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants