Skip to content

Conversation

@cctdaniel
Copy link
Contributor

@cctdaniel cctdaniel commented Jun 19, 2023

use ZoneInfo instead of pytz because apparently there is a conversion bug from NY->UTC with pytz showing offset as additional 4 minute which is incorrect, could use localize() but it only takes in naive datetime

https://stackoverflow.com/questions/60996205/python-datetime-timezone-conversion-off-by-4-minutes

Copy link
Contributor

@ali-behjati ali-behjati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Can you add dt = dt.astimezone(NY_TZ) to is_market_open function too?

@cctdaniel
Copy link
Contributor Author

is_market_open

ah sorry left that out

@cctdaniel cctdaniel merged commit 944a24b into main Jun 19, 2023
@cctdaniel cctdaniel deleted the next-close branch June 19, 2023 11:36
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

Successfully merging this pull request may close these issues.

3 participants