Skip to content

TimestampFilter uses wrong format when timezone != GMT #472

@metskem

Description

@metskem

I am using the following code(snippet) :

dateFilter := client.TimestampFilterList{}
dateFilter.Before(graceDate)

serviceInstanceListOptions := client.ServiceInstanceListOptions{
      ListOptions:          &client.ListOptions{UpdatedAts: dateFilter},
}
serviceInstances, err := cfClient.ServiceInstances.ListAll(ctx, &serviceInstanceListOptions)

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'

My guess is this requires some tweaks in the Serializer?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions