Question

pxConvertPageToString change date format

Hello

I convert my page to JSON using the pxConvertPageToString function and in JSON I get the date format "YYYY-MM-DD". How can I get the date format "YYYYMMDD"? Thanks in advance for your help

Comments

Keep up to date on this post and subscribe to comments

August 22, 2019 - 10:26pm

Hi

You can try changing the format using FormatDateTime function before converting the page to JSON.

 

Regards

Bhavya

Pega
August 25, 2019 - 5:57am

While parsing page to JSON Pega converts Pega date/ DateTime to JSON's DateTime. This is the expected behavior. 

Please refer to the article on this link- https://community.pega.com/support/support-articles/inconsistent-output-ootb-functions-date-type-property

We also had a similar requirement, instead of storing the data in DateTime/ Date properties we created a corresponding text property in the Integration layer and did the conversion to the required format.