Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

AD - Termdate date format error

IAM_99
Regular Contributor II
Regular Contributor II

Hi Team,

we have a custom date column in Active directory which is accepting date like below

IAM_99_2-1669791387769.png

IAM_99_1-1669791370068.png

We have tried to set value for this like below but its failing throwing groovy syntax error.

${if(user.termDate!=null){new java.text.SimpleDateFormat('YYYYMMDDhh:mm:ss.000').format(user.termDate)}else{''}

Can share any syntax to set this date value or any better way on this ?

2 REPLIES 2

rushikeshvartak
All-Star
All-Star

Please share error from logs.

Please check if below works

new java.text.SimpleDateFormat("YYYYMMDDhh:mm:ss.000").format(new java.util.Date())


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

IAM_99
Regular Contributor II
Regular Contributor II

Tried below its working

"${if(user.termDate != null && user.termDate != ''){ java.time.LocalDate.parse(user.termDate.toString().trim().replaceAll(' 00:00:00', '').replace('.0','')).minusDays(1).toString().replaceAll('-', '')+'235959.0Z'} }",