Date formatting for API call

I am working to integrate with an API that calls time series data. The call requests a time code formatted in RFC3339 (URI escaped).

Example:
start=2021-04-14T00%3A00%3A00Z
end=2022-04-14T00%3A00%3A00Z

Tried using the format as JSON safe & the code below. Neither seems to be working. It always sends back a response it isn’t formatted properly.

Screen Shot 2022-11-17 at 12.27.38 PM

Any ideas how to get this working?

Hi @insightrade,

If you want to match your date to your example:
start=2021-04-14T00%3A00%3A00Z
Try this custom date formating:
YYYY-MM-DDTHH%3AMM%3ASSZ

1 Like

Thanks for taking a look. Didn’t realize I could insert the characters T and Z inline like that. I went to the docs and didn’t find much there.

One note on solution - It appears bubble escapes the : character. I was able to use this instead of hardcoding in the URI formatting:
YYYY-MM-DDTHH:MM:SSZ

Had trouble finding a way to see what the rendered API call is using the debugger. That would be a useful tool to have. Is there a way to see what API call is generated?

This is works for me:
yyyy-mm-dd"T"HH:MM:ss"Z"