I have a question that maybe a bit dumb but i need to receive data from a REST API that requires a dateTimeZuluType. Is there a way to convert the UTC to have or be able to read the Zulu date time? Because i tried to append the z, but i can't because of the date time. 

Thanks in advance!

Solution

Hi Bart,

When consuming a REST API, The Platform will automatically convert any DateTime to UTC. When receiving a UTC DateTime, the Platform will automatically convert it to local time. Have you seen otherwise, or just assumed the Platform wouldn't do this?

Solution

Kilian Hekhuis wrote:

Hi Bart,

When consuming a REST API, The Platform will automatically convert any DateTime to UTC. When receiving a UTC DateTime, the Platform will automatically convert it to local time. Have you seen otherwise, or just assumed the Platform wouldn't do this?

@Paulo: that's a useful component, but not necessary or useful in this case.


Hi Killian,

I didn't know the platform did this automatically! Out of curiosity; does it work the other way around as well? So if i send a date time via an exposed REST it will change it automatically as well and is it the same with Binary?

Thanks for your answer!

Hi Bart,

Yes, any date/time you send will be converted to UTC first before it's sent to the consumed REST API.

I'm not sure what you mean by "is it the same with Binary". Can you elaborate?

Kilian Hekhuis wrote:

Hi Bart,

Yes, any date/time you send will be converted to UTC first before it's sent to the consumed REST API.

I'm not sure what you mean by "is it the same with Binary". Can you elaborate?

If you receive binary data, will it recognize if there are date time data type records in the file and convert them?


Hi Bart,

Binary data does not have a defined structure, nor is there any standard for encoding a date/time in binary, so the answer is "no". JSON encodes its data as text, not as binary, so any meaningful data is sent via text. Use binary only for things like files.

Thanks for both your answers, have a nice day!

You too, happy coding :)