Skip to content

date.today() should not be used #2

Description

@RealBuddy

I'm not sure, but I guess we shouldn't use date.today() to get current_date for "{current_date} 09:30:00-04:00"
date.today() will give you the local current date and at some time of the day (or night) it will be different with the US/Eastern date.
As long as we are using pytz for the is_dst hack, I would suggest to use it this way to sync with 'US/Eastern':
current_datetime = datetime.datetime.now(pytz.timezone('US/Eastern'))
utcoffset = str(current_datetime)[-6:]
current_date = current_datetime.date().isoformat()
start_minute_bar = f"{current_date} 09:30:00{utcoffset}"

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions