In data action, I need to call API that need date time in ISO format. Is there any way for me to convert or get current date time in iso format?
It is FormateDateTime function you will need to use. i have uploaded oml which displays ISO formate.
As mentioned by others earlier, to convert the current time to ISO 8601 format in OutSystems, you should use the following expression:
FormatDateTime(DateVariable, "yyyy-MM-ddTHH:mm:ssZ")
Important:Always use the format "yyyy-MM-ddTHH:mm:ssZ" to ensure the correct ISO 8601 representation.
This will help you format your date properly for API calls or other requirements.
If you have any further questions, feel free to ask!
If this format works for you, please mark it as a solution. This will help others with the same issue find the solution more easily.
Hi Muhammad,
What type of API you need to call? If is a REST API you can define the date format here:
Cheers,
Rúben
I need to pass the parameter on POST. The parameter for DateTime need to be converted to ISO format.
The platform will do that for you automatically :)
You just need to have your parameter with the data type Date Time
you can use something like following to conver datetime to iso format
CurrDateTime = CurrDateTime()
IsoDateTime = DateTimeToText(CurrDateTime, "yyyy-MM-ddTHH:mm:ss")
I cant use the function you mention as it only accept 1 parameter
Hello Muhammad,
I believe what you are looking for is the FormatDateTime() function.
You can check the documentation page, which has some examples:
Best regards,
Ana