From 81ad791747fdb3645cb684b34a9c4162508f2e52 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Mon, 23 Jul 2018 17:55:36 +0800 Subject: [PATCH] =?UTF-8?q?[Mod]=E4=BF=AE=E6=94=B9DataRecording=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AF=B9=E4=BA=8ETick=E6=97=B6=E9=97=B4=E6=88=B3?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86=EF=BC=8C=E5=85=BC=E5=AE=B9=E6=9F=90?= =?UTF-8?q?=E4=BA=9B=E8=A1=8C=E6=83=85=E6=BA=90Tick=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3=E6=B2=A1=E6=9C=89=E6=AF=AB=E7=A7=92=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/app/dataRecorder/drEngine.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vnpy/trader/app/dataRecorder/drEngine.py b/vnpy/trader/app/dataRecorder/drEngine.py index 5b29f3dd..ba6049af 100644 --- a/vnpy/trader/app/dataRecorder/drEngine.py +++ b/vnpy/trader/app/dataRecorder/drEngine.py @@ -175,7 +175,10 @@ class DrEngine(object): # 生成datetime对象 if not tick.datetime: - tick.datetime = datetime.strptime(' '.join([tick.date, tick.time]), '%Y%m%d %H:%M:%S.%f') + if '.' in tick.time: + tick.datetime = datetime.strptime(' '.join([tick.date, tick.time]), '%Y%m%d %H:%M:%S.%f') + else: + tick.datetime = datetime.strptime(' '.join([tick.date, tick.time]), '%Y%m%d %H:%M:%S') self.onTick(tick)