10.2.48 MySQLConnection.time_zone Свойство
Это свойство используется для установки или получения переменной сеанса часового пояса для текущего подключения.
>>> cnx.time_zone = '+00:00'
>>> cursor = cnx.cursor()
>>> cursor.execute('SELECT NOW()') ; cursor.fetchone()
(datetime.datetime(2012, 6, 15, 11, 24, 36),)
>>> cnx.time_zone = '-09:00'
>>> cursor.execute('SELECT NOW()') ; cursor.fetchone()
(datetime.datetime(2012, 6, 15, 2, 24, 44),)
>>> cnx.time_zone
u'-09:00'
Возвращает строку.
© 2025 Oracle
Licensed under the GPLv2 License.