Ejemplo n.º 1
0
 def conventDataForSave(self,dat):
     # {'timestamp': '2018-03-14T15:17:00.000Z', 'symbol': 'XBTUSD', 'open': 8707.5, 'high': 8720, 'low': 8706, 'close': 8716.5, 'trades': 357, 'volume': 1488175, 'vwap': 8710.0427, 'lastSize': 500, 'turnover': 17086355694, 'homeNotional': 170.86355693999997, 'foreignNotional': 1488175},
     outs = []
     for d in dat:
         utctime = d['timestamp']
         timest = timetool.utcStrTimeToTime(utctime)
         timeint = int(timest)
         ltimeStr = timetool.timestamp2datetime(timeint,True)
         opentmp = d['open']
         hithtmp = d['high']
         lowtmp = d['low']
         closetmp = d['close']
         volumetmp = d['volume']
         symboltmp = d['symbol']
         outs.append([timeint,opentmp,hithtmp,lowtmp,closetmp,volumetmp,symboltmp,str(ltimeStr)])
     return outs
Ejemplo n.º 2
0
 def timeconvent(self,utcstrtime):
     timest = timetool.utcStrTimeToTime(utcstrtime)
     timeint = int(timest)
     ltimeStr = str(timetool.timestamp2datetime(timeint,True))   
     return timeint,ltimeStr 
Ejemplo n.º 3
0
def main():
    utc = "2018-03-14T13:40:00.000Z"
    # print(timetool.utcStrTimeToTime(utc))
    print(timetool.utcStrTimeToTime(utc))
Ejemplo n.º 4
0
def test():

    dt = '2018-03-14T15:03:00.000Z'
    print(timetool.utcStrTimeToTime(dt))