how do you set a time zone to new york with a python mysql connector?

I figured it out.

arbitrage_db = mysql.connector.connect(  # connecting to arbing db
    host="your host",
    user="username",
    password="password",
    database="database"
    )
cursor = arbitrage_db.cursor()
cursor.execute('SELECT NOW()')
for time in cursor:
    print(time)
print()
arbitrage_db.time_zone = "-04:00"
cursor.execute('SELECT NOW()')
for time in cursor:
    print(time)
cursor.close()
arbitrage_db.close()

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top