220
Views
3
Comments
API date format - ISO 8601 support

Is there a way to configure ISO 8601 as date format for an API mapping? I see only ISO, UNIX and WCF.

I've read about manual text formatting but I'm looking for a more convenient way.

Is there a way to enable the  ISO 8601 (2022-06-30T11:06:14.000Z) as an option in the Advanced / Date Format dialog?


Without it, I must text replace all my JSON responses through Regex inside OnAfterResponse actions. :(

2019-09-24 18-41-25
Jorge Martins
 
MVP

Hi @Ricardo Campos,

Isn't the ISO option the format you want?... After all the ISO standard for representing dates and times is ISO 8601.

Have you tried using it? If it doesn't behave as you expect, can you provide more insight on what you see as outcome when you try calling your REST API from OutSystems?

Cheers

2019-09-24 18-41-25
Jorge Martins
 
MVP

Just a quick follow up. OutSystems DateTime data type does not support timezone information, which can explain whatever behaviour you are observing. You would probably need to preprocess the response to extract the offset before allowing the platform to convert it to the OutSystems structure (using OnAfterResponse callback).

2019-09-24 18-41-25
Jorge Martins
 
MVP

And as a third follow up (sorry, was researching on this), I found this article by @Remco Dekkinga on how OutSystems handles dates from different sources, you might find it an interesting read.

In particular: "For incoming data, the system can handle each DateTime value, as long as it is in ISO8601 format".

Hope this helps!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.