--服务器时间 大部分为04-26 select collector_tstamp :: date,count(*) from dev.events group by collector_tstamp :: date order by count(*) desc; 2015-04-26 1012769 2015-04-27 16932 —设备时间 大部分为04-26 select dvce_tstamp :: date,count(*) from dev.events group by dvce_tstamp :: date order by count(*) desc; 2015-04-26 938746 2015-04-25 90488 2015-04-27 174 ....(小于100)
select datediff(m,collector_tstamp,dvce_tstamp) as minute,count(*) from dev.events group by datediff(m,collector_tstamp,dvce_tstamp) order by count(*) desc; Minutes cnt -480 949916 -479 24772 -481 17785 -478 8325 -477 4397 -476 3000 -482 2852 -475 2492 -474 2219 -473 1628 -470 1384 -469 1103
row['dvce_tstamp'] = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(int(row['dvce_tstamp'])/1000))
原文地址:http://blog.csdn.net/tonylee0329/article/details/45538893