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
{{ message }}
Repository navigation
TimestampFilter uses wrong format when timezone != GMT #472
This works fine as long as your local timezone is GMT, then RCF3339 formats to something like 'YYYY-MM-DDThh:mm:ssZ', which is the format the CF V3 API expects.
In my case the timezone is Europe/Amsterdam, and then RFC3339 formats to 'YYYY-MM-DDThh:mm:ss+02:00'
The ListAll call returns the error:
error executing GET request for /v3/service_instances?updated_ats%5Blt%5D=2025-05-10T11%3A54%3A11%2B02%3A00: cfclient error (CF-BadQueryParameter|10005): The query parameter is invalid: Updated ats has an invalid timestamp format. Timestamps should be formatted as 'YYYY-MM-DDThh:mm:ssZ'
You're correct, the API expects all timestamps to be in UTC, no timezone offset.
I worry that if the client serializer auto-converts the given timestamp to UTC it will not be what the consumer of the client expected. I think it's probably better to get an error so the client consumer knows to pass a UTC timestamp and knows there's a conversion happening. If anything I think I might like to see a clearer error message from the client instead of a query parameter error returned from the API. What do you think?
Hmm, TBH the results being returned this way would be exactly what I expected.
The timestamp passed in by the consumer is honored.
If the consumer would pass a Europe/Amsterdam timestamp of 09:00, or a UTC timestamp of 07:00, he would get the same results.
Activity
metskem commentedon May 20, 2025
BTW, the unescaped URL is
/v3/service_instances?updated_ats[lt]=2025-05-10T11:54:11+02:00Maybe changing
timestamp.Format(time.RFC3339)to
timestamp.UTC().Format(time.RFC3339)would suffice.
sneal commentedon May 28, 2025
You're correct, the API expects all timestamps to be in UTC, no timezone offset.
I worry that if the client serializer auto-converts the given timestamp to UTC it will not be what the consumer of the client expected. I think it's probably better to get an error so the client consumer knows to pass a UTC timestamp and knows there's a conversion happening. If anything I think I might like to see a clearer error message from the client instead of a query parameter error returned from the API. What do you think?
metskem commentedon May 29, 2025
Hmm, TBH the results being returned this way would be exactly what I expected.
The timestamp passed in by the consumer is honored.
If the consumer would pass a Europe/Amsterdam timestamp of 09:00, or a UTC timestamp of 07:00, he would get the same results.