Sfoglia il codice sorgente

// GetServerTime 获取服务器时间: 返回UTC+8格式

deng.yinping 1 anno fa
parent
commit
fe4413a94e
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      models/common.go

+ 1 - 1
models/common.go

@@ -740,7 +740,7 @@ func GetServerTime() (*string, error) {
 	engine := db.GetEngine()
 
 	// rst, err := engine.QueryString("select sysdate from dual")
-	rst, err := engine.QueryString("select to_char(sysdate, 'yyyy-MM-dd hh24:mi:ss') \"SYSDATE\" from dual")
+	rst, err := engine.QueryString("select TO_CHAR(SYSDATE, 'YYYY-MM-DD\"T\"HH24:MI:SS') || '+08:00' \"SYSDATE\" from dual")
 	if err != nil {
 		return nil, err
 	}