Open ricardo-kagawa opened 5 months ago
Forgot to mention that the issue can be worked around using the UTC time zone, like this (in Linux):
TZ=UTC deno test --allow-all repro.ts
Hi @ricardo-kagawa, thanks for highlighting this issue. I think you're right on both accounts. Looks like we should be using getUTCHours()
instead of getHours()
(as well as minutes, seconds, etc.). Additionally we should be returning a Date from the formatter, as it looks like the other SDKs return some sort of Date/Time object, and not a string. This should be a relatively easy, I will work with the team to implement it.
At least for the
lastModified
field ofgetObject
responses fromObjectStorageClient
, and likely for any client generating response fields of typeDate
from HTTP headers, the response field is formatting the parsed header value using the local time zone, despite the formatted value using theZ
(UTC) time zone specifier.https://github.com/oracle/oci-typescript-sdk/blob/52a6526faa186dfdc3f8af6f52458ac29e4dc458/lib/common/lib/helper.ts#L299
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getHours
Also, the SDK documentation mentions it should have the
Date
type, but the field is of typestring
. The TypeScript declaration also declares it asDate
, but the value seems to come verbatim from that formatter, which declares astring
return value as seen above.The following code should reproduce these issues in Deno: