From 8c9c126bb980f9932fbf3b80b69ed95e8683b6d4 Mon Sep 17 00:00:00 2001 From: wisfern Date: Thu, 10 Aug 2017 17:13:53 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E8=A1=A5=E9=BD=90=E9=93=BE=E8=A1=8C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=B8=AD=E6=AF=AB=E7=A7=92=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/gateway/lhangGateway/lhangGateway.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vnpy/trader/gateway/lhangGateway/lhangGateway.py b/vnpy/trader/gateway/lhangGateway/lhangGateway.py index 174906e6..8e43d84d 100644 --- a/vnpy/trader/gateway/lhangGateway/lhangGateway.py +++ b/vnpy/trader/gateway/lhangGateway/lhangGateway.py @@ -180,7 +180,7 @@ class LhangApi(LhangApi): err = VtErrorData() err.gatewayName = self.gatewayName err.errorMsg = str(error) - err.errorTime = datetime.now().strftime('%H:%M:%S') + err.errorTime = datetime.now().strftime('%H:%M:%S.%f')[:-3] self.gateway.onError(err) #---------------------------------------------------------------------- @@ -236,7 +236,7 @@ class LhangApi(LhangApi): tick.askPrice5, tick.askVolume5 = data['asks'][4] now = datetime.now() - tick.time = now.strftime('%H:%M:%S') + tick.time = now.strftime('%H:%M:%S.%f')[:-3] tick.date = now.strftime('%Y%m%d') self.gateway.onTick(tick) @@ -356,7 +356,7 @@ class LhangApi(LhangApi): trade.direction = order.direction trade.offset = order.offset trade.exchange = order.exchange - trade.tradeTime = datetime.now().strftime('%H:%M:%S') + trade.tradeTime = datetime.now().strftime('%H:%M:%S.%f')[:-3] self.gateway.onTrade(trade) @@ -447,7 +447,7 @@ class LhangApi(LhangApi): err = VtErrorData() err.gatewayName = self.gatewayName err.errorMsg = u'链行接口仅支持限价单' - err.errorTime = datetime.now().strftime('%H:%M:%S') + err.errorTime = datetime.now().strftime('%H:%M:%S.%f')[:-3] self.gateway.onError(err) return None @@ -480,7 +480,7 @@ class LhangApi(LhangApi): order.offset = OFFSET_UNKNOWN order.price = req.price order.volume = req.volume - order.orderTime = datetime.now().strftime('%H:%M:%S') + order.orderTime = datetime.now().strftime('%H:%M:%S.%f')[:-3] order.status = STATUS_UNKNOWN self.workingOrderDict[localID] = order