From 2b686053206094bddca69368b4bf7581128ec18a Mon Sep 17 00:00:00 2001 From: Bian Jiang Date: Thu, 5 May 2016 21:11:08 +0800 Subject: [PATCH] FIX from UTC time to local time --- vn.trader/ibGateway/ibGateway.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vn.trader/ibGateway/ibGateway.py b/vn.trader/ibGateway/ibGateway.py index 12e9ae6a..5658ff88 100644 --- a/vn.trader/ibGateway/ibGateway.py +++ b/vn.trader/ibGateway/ibGateway.py @@ -338,7 +338,7 @@ class IbWrapper(EWrapper): def tickString(self, tickerId, tickType, value): """行情推送,特殊字段相关""" if tickType == 45: - dt_obj = datetime.utcfromtimestamp(int(value)) + dt_obj = datetime.fromtimestamp(int(value)) tick = self.tickDict[tickerId] tick.time = dt_obj.strftime('%H:%M:%S.%f') @@ -572,7 +572,7 @@ class IbWrapper(EWrapper): #---------------------------------------------------------------------- def currentTime(self, time): """ generated source for method currentTime """ - dt_obj = datetime.utcfromtimestamp(time) + dt_obj = datetime.fromtimestamp(time) t = dt_obj.strftime("%Y-%m-%d %H:%M:%S.%f") self.connectionStatus = True