Permalink
Browse files

Consider time zones when querying for billing events

[fixes #43617383]

Change-Id: Icd8e9a6b14b182ad37fd8222efcb918f16881cf5
  • Loading branch information...
Nate Clark
Nate Clark committed Feb 1, 2013
1 parent c8b9bdc commit 0cabfa729639424e033b5f951071b0806974c7fc
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/cloud_controller/api/billing_event.rb
  2. +2 −2 spec/api/billing_event_spec.rb
@@ -35,7 +35,7 @@ def end_time
def parse_date_param(param)
str = @params[param]
- Time.parse(str) if str
+ Time.parse(str).localtime if str
rescue
raise Errors::BillingEventQueryInvalid
end
@@ -82,8 +82,8 @@ module VCAP::CloudController
describe 'GET /v2/billing_events?start_date=#{start_date}&end_date=#{end_date}' do
let(:path) do
"/v2/billing_events?" +
- "start_date=#{@start_time.iso8601}" +
- "&end_date=#{@end_time.iso8601}"
+ "start_date=#{@start_time.utc.iso8601}" +
+ "&end_date=#{@end_time.utc.iso8601}"
end
context "as a cf admin" do

0 comments on commit 0cabfa7

Please sign in to comment.