From 9874129880d4f042919361097ed8a1057f1e24ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 23 Feb 2015 12:56:52 +0100 Subject: [PATCH] Bug #3623: Make oneacct end-time be the last included date --- src/cli/oneacct | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/cli/oneacct b/src/cli/oneacct index 40f953e11c..38f39f434b 100755 --- a/src/cli/oneacct +++ b/src/cli/oneacct @@ -55,7 +55,21 @@ cmd = CommandParser::CmdParser.new(ARGV) do filter_flag = (options[:userfilter] || VirtualMachinePool::INFO_ALL) start_time = options[:start_time] ? options[:start_time].to_i : -1 - end_time = options[:end_time] ? options[:end_time].to_i : -1 + + end_time = -1 + + if (!options[:end_time].nil?) + # Not the safest way to add a day, but since managing date/time + # in ruby is... not entirely convenient, this will do + + t = options[:end_time] + + if (t.hour == 0 && t.min == 0 && t.sec == 0) + t += 24*60*60 + end + + end_time = t.to_i + end common_opts = { :start_time => start_time,