fix: time zone
This commit is contained in:
parent
0b310025d6
commit
b636d3d9b2
1 changed files with 4 additions and 1 deletions
|
@ -42,13 +42,16 @@ class PostgresTab(TabPage):
|
|||
|
||||
def connectToDatabase(self):
|
||||
try:
|
||||
self.conn = psycopg2.connect(database=self.dbName, user=self.user, password=self.password, host=self.host, port=self.port, timezone="Asia/Shanghai")
|
||||
self.conn = psycopg2.connect(database=self.dbName, user=self.user, password=self.password, host=self.host, port=self.port)
|
||||
self.cur = self.conn.cursor()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
self.cur = None
|
||||
QMessageBox.critical(self, 'Error', str(e))
|
||||
|
||||
# 设置时区
|
||||
self.execute("set TimeZone='Asia/Shanghai'")
|
||||
|
||||
def disconnectFromDatabase(self):
|
||||
try:
|
||||
if (self.cur is None):
|
||||
|
|
Loading…
Reference in a new issue