Parse date picker to ISO for API call

Hi Everyone, I’m struggling to parse a date value selected in an element to a format which can be used in an API call.

For the API call to work I need a start and end time stamp in the following format: startTimestamp=2024-01-01T00%3A00%3A00Z&endTimestamp=2024-12-30T00%3A00%3A00Z

When I setup the call I manually added parameters like this and it worked fine:
startTimestamp = 2024-01-01T00:00:00Z
endTimestamp = 2024-12-30T00:00:00Z

When looking at the API documentation it allows me to add these values as a test parameter and gives the below format for cURL:
www.endpoint.com/example?startTimestamp=2024-01-01T00%3A00%3A00Z&endTimestamp=2024-12-30T00%3A00%3A00Z

I’ve tried setting the date picker element to a custom format and then just adding “T00%3A00%3A00Z” as arbitrary text afterwards but doesn’t seem to work. I only care about year, month, date for the timestamp so generic seconds etc would be fine.

Thanks for your help!

It simple, select the date element value and choose format as custome date format : YYYY-MM-DDTHH:mm:ssZ

i DM you a video

1 Like

Thanks for the response @Baloshi69 and I really appreciate the video but I’m still not getting the right data. In my screenshot following your instructions I don’t get proper date values but some text the API cannot parse.

You will see in your video also the parameters added to the page include YYYY-DD-30 instead of 2025-06-01. I think we are on the right track but any more advice you have on how to get the date numbers instead of letters would be really appreciated!


@Baloshi69 I did it literally 2 mins after respond to you! So there is a format called “Simplified extended ISO” which gives the correct format. I would not have been able to find it without your input so thank you

1 Like