1 か月分の請求書を取得しようとしています (1 か月の初めから翌月の初めまで)。ただし、予期しない結果セットに最終月の最初の日の結果が表示されます。
たとえば、これは 12 月 1 日の請求書を返します。
account = SoftLayer::Service.new("...")
billing_invoice_service = softlayer_client.service_named("Billing_Invoice");
object_filter = SoftLayer::ObjectFilter.new
object_filter.set_criteria_for_key_path('invoices.createDate',
'operation' => 'betweenDate',
'options' => [{
'name' => 'startDate',
'value' => ["11/01/2015 00:00:00"]
},
{
'name' => 'endDate',
'value' => ["12/01/2015 00:00:00"]
}
]
)
invoices = account.result_limit(0,5000).object_filter(object_filter).object_mask("mask[id,closedDate,createDate]").getInvoices
以下のフィルターで実行すると、12 月 1 日の結果が得られません。
account = SoftLayer::Service.new("...")
billing_invoice_service = softlayer_client.service_named("Billing_Invoice");
object_filter = SoftLayer::ObjectFilter.new
object_filter.set_criteria_for_key_path('invoices.createDate',
'operation' => 'betweenDate',
'options' => [{
'name' => 'startDate',
'value' => ["12/01/2015 00:00:00"]
},
{
'name' => 'endDate',
'value' => ["12/01/2015 00:00:00"]
}
]
)
invoices = account.result_limit(0,5000).object_filter(object_filter).object_mask("mask[id,closedDate,createDate]").getInvoices
そのため、終了時刻を 00:00:00 に指定したときに、最初のフィルターで 12 月 1 日の結果が得られる理由がわかりません。ありがとうございました。
編集: 上記の最初のフィルターの結果の末尾を次に示します (id を除く)。
...
{"closedDate"=>"2015-11-30T21:52:17+05:30",
"createDate"=>"2015-11-30T21:52:16+05:30"},
{"closedDate"=>"2015-11-30T23:22:14+05:30",
"createDate"=>"2015-11-30T23:22:13+05:30"},
{"closedDate"=>"2015-12-01T01:43:59+05:30",
"createDate"=>"2015-12-01T01:43:56+05:30"},
{"closedDate"=>"2015-12-01T01:45:36+05:30",
"createDate"=>"2015-12-01T01:45:34+05:30"},
{"closedDate"=>"2015-12-01T02:05:20+05:30",
"createDate"=>"2015-12-01T02:05:16+05:30"},
{"closedDate"=>"2015-12-01T02:12:22+05:30",
"createDate"=>"2015-12-01T02:12:22+05:30"},
{"closedDate"=>"2015-12-01T02:13:06+05:30",
"createDate"=>"2015-12-01T02:13:04+05:30"},
{"closedDate"=>"2015-12-01T02:13:07+05:30",
"createDate"=>"2015-12-01T02:13:04+05:30"},
{"closedDate"=>"2015-12-01T02:13:07+05:30",
"createDate"=>"2015-12-01T02:13:05+05:30"},
{"closedDate"=>"2015-12-01T02:13:08+05:30",
"createDate"=>"2015-12-01T02:13:06+05:30"},
{"closedDate"=>"2015-12-01T02:13:07+05:30",
"createDate"=>"2015-12-01T02:13:06+05:30"},
{"closedDate"=>"2015-12-01T02:21:34+05:30",
"createDate"=>"2015-12-01T02:21:32+05:30"},
{"closedDate"=>"2015-12-01T02:38:12+05:30",
"createDate"=>"2015-12-01T02:38:10+05:30"},
{"closedDate"=>"2015-12-01T03:36:07+05:30",
"createDate"=>"2015-12-01T03:36:06+05:30"},
{"closedDate"=>"2015-12-01T04:09:57+05:30",
"createDate"=>"2015-12-01T04:09:55+05:30"},
{"closedDate"=>"2015-12-01T04:37:45+05:30",
"createDate"=>"2015-12-01T04:37:43+05:30"},
{"closedDate"=>"2015-12-01T06:35:34+05:30",
"createDate"=>"2015-12-01T06:35:33+05:30"},
{"closedDate"=>"2015-12-01T07:00:09+05:30",
"createDate"=>"2015-12-01T07:00:06+05:30"},
{"closedDate"=>"2015-12-01T08:00:32+05:30",
"createDate"=>"2015-12-01T08:00:30+05:30"}]