From c4b2867bf6505b5980a49daaa70637071bde43cd Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 6 Feb 2020 14:18:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A7=86=E9=A2=91=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/get_video_data.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/get_video_data.rake b/lib/tasks/get_video_data.rake index 887f76220..49cafcc7b 100644 --- a/lib/tasks/get_video_data.rake +++ b/lib/tasks/get_video_data.rake @@ -1,16 +1,16 @@ namespace :video do desc "get video play data" task :data => :environment do - start_times = ['2019-08-19T00:00:00Z', '2019-11-10T00:00:00Z'] - end_times = ['2019-11-09T23:59:59Z', '2020-02-06T00:00:00Z'] + start_times = ['2019-08-19 00:00:00', '2019-11-10 00:00:00'] + end_times = ['2019-11-09 23:59:59', '2020-02-06 00:00:00'] Video.all.each do |video| vv = 0 play_duration = 0 start_times.each_with_index do |time, index| - start_time = time - end_time = end_times[index] + start_time = time.to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ') + end_time = end_times[index].to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ') data = AliyunVod::Service.video_data(video.uuid, start_time, end_time)