Closed samuelastech closed 1 year ago
[...]
errorObject: OciError: Passed UTC date does not have the right precision: hours, minutes, seconds, and second fractions must be 0
@samuelastech can you share the code you are running which is giving you this issue?
From the error, it sounds like there is a parameter in the operation you are calling, and for that parameter you are passing a datetime value which has at least some of the following components of the datetime set to a non-zero value: hours, minutes, seconds, and/or second fractions. These components of the datetime need to be set to 0, per the error message.
Here is my code:
const usageDetails = {
tenantId: provider.getTenantId(),
granularity: models.RequestSummarizedUsagesDetails.Granularity.Monthly,
timeUsageStarted: new Date("2023-02-02"),
timeUsageEnded: new Date("2023-03-05"),
};
I didn't understand your explanation. I need to set datetime values to zero?
I solve it by using:
timeUsageStarted: new Date(Date.UTC(2022, 06, 01, 0, 0, 0, 0)),
timeUsageEnded: new Date(Date.UTC(2023, 03, 07, 0, 0, 0, 0)),
I'm trying to use the
UsageAPI
but always getting this error: