Does Outsystems support ISO-8601 date formats?

I'm getting information from an external database which stores date-times in ISO-8601: 

"2019-01-20T01:22:33.123Z"

Is there a nice way to use this in outsystems? Is there a built-in way to convert this to an OS date-time or do I need to use ugly string manipulations? Likewise to turn an OS datetime into a string of the right format to send a date to the API

Solution

Hi MichaelR,

For converting outsystems date to iso-8601 string you can use forge component: https://www.outsystems.com/forge/Overview.aspx?ProjectId=90&ProjectName=extended-datetime

For converting the string to a date you could try to use the JSON Serialize/Deserialize to convert the iso8601 to date. On these function you can set the date format.

Regards,

Daniel

Solution

Daniël Kuhlmann wrote:

Hi MichaelR,

For converting outsystems date to iso-8601 string you can use forge component: https://www.outsystems.com/forge/Overview.aspx?ProjectId=90&ProjectName=extended-datetime

For converting the string to a date you could try to use the JSON Serialize/Deserialize to convert the iso8601 to date. On these function you can set the date format.

Regards,

Daniel

Ah thanks, I'd missed the JSON deserialiser's ability to convert.


To go from DateTime to a string, I found the Text API's Format_DateTime method. I can feed in an OS DateTime and the string "yyyy-MM-ddTHH:mm:ss.000Z", which gets me back to where I started - although I lose the decimals on the seconds since OS DateTime doesn't  seem to support them


Daniël Kuhlmann wrote:

Hi MichaelR,

For converting outsystems date to iso-8601 string you can use forge component: https://www.outsystems.com/forge/Overview.aspx?ProjectId=90&ProjectName=extended-datetime

For converting the string to a date you could try to use the JSON Serialize/Deserialize to convert the iso8601 to date. On these function you can set the date format.

Regards,

Daniel

Hallo Daniel,

i am still using outsystens 10 with the client where i am working.

There is an extenstion extended date time for os 10, but in this version i do not see an action for making an iso 8601 string from an os datetime. the UTC time option that is listed in the feature list does not seem to be resent in the os10 version.

is this the case or am i missing something?

what can i use with os10?

Regards Sven.


Hi Sven,

Maybe you need to download version 10.0.2 the release notes mention functionallity to support iso 8601.

You can download a specific version of a Forge component if you go to the Version tab on the Component home page.

Regards,

Daniel