Convert DateTime to Date Only

In report definition i m doing difference of 2 dates (Date1 - CurrentDateTime). Date1 is in date only format. how can i convert currentdatetime to dateonly. i tried to create function alias but not working. Please let me know.

regards,

Yasvanth.

@Yasvanth Tanuku

Hello,

Regarding your function alias, have you tried to test it? You can test your newly created function by calling it in the expression builder of a transformation rule/method (data transform, property-set in activities,…)

However, another approach would be to appropriately format the property using a response data transform, if you are storing the report définition results in a data page

May you allow me to further understand your issue if the comments above don’t help ; can you provide me : the context where you are planning to use the report definition, the initial datetime format (a sample data) and the expected format (sample data)

Hi @Yasvanth Tanuku,

You don’t need to write any alias for this, you can use pega’s OOTB alias pxDifferenceInDays, and provide a nested alias for current date time in params.

Please refer below snaps for reference :

Outer Alias

Inner Alias

Result

Hope it helps !

Thanks, Ankit

@Yasvanth Tanuku

mentioned link has similar issue.