0
votes

I have a SQL Server Datetime field with value 1962-04-04 00:00:00.0. This needs to be pushed into Salesforce date field through Mule. I am handling this conversion in the data mapper.

I have tried many possibilities but nothing works. Any pointers would help.

The last one I tried was as below. I thought it should work.

output.PersonBirthdate1 = str2date(input.DATE_OF_BIRTH, "yyyy-MM-dd hh:mm:ss.ZZZ"); 

But it gives an error:

Caused by: [Error: java.text.ParseException: Unparseable date: "1962-04-04 00:00:00.0"]
1
Any specific reason you're passing the time (and timezone / .ZZZ)? - admdrew
@admdrew the date format in SQL is 1962-04-04 00:00:00.000 So I thought the last three digits corresponds to timezone. - Jaguar
Right. Do you need the timezone if you're just storing the date? Try taking out .ZZZ and .000 - admdrew
Have you tried removing the . character? ("yyyy-MM-dd hh:mm:ss ZZZ") - admdrew
"It is a SQL Server Column" well, technically, it's in input.DATE_OF_BIRTH. Can't you massage that data before sending it to str2date? - admdrew

1 Answers

0
votes

Bases on the format of the date,it would be:

str2date(input.DATE_OF_BIRTH,"yyyy-MM-dd HH:mm:ss.S")