oci-typescript-sdk icon indicating copy to clipboard operation
oci-typescript-sdk copied to clipboard

OciError: Forecasting invalid date range: Passed UTC date does not have the right precision: hours, minutes, seconds, and second fractions must be 0

Open samuelastech opened this issue 2 years ago • 1 comments

I'm passing the following object:

requestSummarizedUsagesDetails: {
  isAggregateByTime: true,
  tenantId: this.#provider.getTenantId(),
  timeUsageStarted: new Date(Date.UTC(2023, 6, 18, 0, 0, 0, 0)),
  timeUsageEnded: new Date(Date.UTC(2023, 7, 18, 0, 0, 0, 0)),
  granularity: usageapi.models.RequestSummarizedUsagesDetails.Granularity.Daily,
  queryType: usageapi.models.RequestSummarizedUsagesDetails.QueryType.Cost,
  forecast: {
    forecastType: usageapi.models.Forecast.ForecastType.Basic,
    timeForecastStarted: new Date(Date.UTC(2023, 7, 18, 0, 0, 0, 0)),
    timeForecastEnded: new Date(Date.UTC(2023, 8, 3, 0, 0, 0, 0))
  },
}

And yet facing the "Passed UTC date does not have the right precision: hours, minutes, seconds, and second fractions must be 0" error.

What have I done wrong?

samuelastech avatar Jul 18 '23 18:07 samuelastech

@samuelastech are you still facing this issue with the latest SDK version?

bhagwatvyas avatar Mar 21 '24 01:03 bhagwatvyas