Question
Converting BigDecimal to Date
Hi,
We have a requirement to create a function in pega to find the number of days between two given inputs, in which one input parameter can be either DateTime(yyyyMMddTHHmmss.SSS z) or Date (yyyyMMdd). Seems pega internally passes the BigDecimal format to the function when a strategy invokes this function, So we have to create a function which takes the Date/DateTime as BigDecimal. Can somebody help us how can we convert BigDecimal to java.util.Date (or DateTime).
Thanks
***Edited by Moderator Marissa to update categories***
I think you can use the DateTimeDifference Function.
Here is a sample conversion used by CSHC for similar computations. The DateOfBirth is a Date and is normalized to a date time by adding the T000000.000 GMT string.
@(Pega-RULES:DateTime).DateTimeDifference(pyWorkPage.Member.DateOfBirth + "T000000.000 GMT" , @(Pega-RULES:DateTime).CurrentDateTime(), "M")
Hope that helps.