You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found an issue for how some Dates are being formatted. This bug is found in a common library function so I believe the impact to be significant.
I found this while trying to listProblems from the CloudGuard client. I was passing a JS Date for the timeFirstDetectedGreaterThanOrEqualTo parameter and receiving a 400 Invalid Date error.
let validDate = new Date('2024-08-28T08:15:34Z'); => Wed Aug 28 2024 02:15:34 GMT-0600 (Mountain Daylight Time)
let invalidString =formatDateToRFC3339(validDate); => 2024-08-28T2:15:34Z (notice that the hour is a single digit)
new Date(invalidString); => Invalid Date
Please consider using ("0" + date.getHours()).slice(-2) or something similar to make sure hours contains two digits.
The text was updated successfully, but these errors were encountered:
VDubber
changed the title
Timestamp format is invalid
Timestamp format is invalid causing API requests to fail
Oct 2, 2024
Hello,
I have found an issue for how some Dates are being formatted. This bug is found in a common library function so I believe the impact to be significant.
I found this while trying to
listProblems
from the CloudGuard client. I was passing a JS Date for thetimeFirstDetectedGreaterThanOrEqualTo
parameter and receiving a 400 Invalid Date error.This line here is the issue.
Consider the following:
let validDate = new Date('2024-08-28T08:15:34Z'); => Wed Aug 28 2024 02:15:34 GMT-0600 (Mountain Daylight Time)
let invalidString =formatDateToRFC3339(validDate); => 2024-08-28T2:15:34Z (notice that the hour is a single digit)
new Date(invalidString); => Invalid Date
Please consider using
("0" + date.getHours()).slice(-2)
or something similar to make sure hours contains two digits.The text was updated successfully, but these errors were encountered: