Salesforce date from lightning calender parse in apex

42 Views Asked by At

I am passing the lightning date picker value to apex class as a string. In apex trying to parse date to insert into the database but getting an error that date format is invalid. I am doing it the following way.

Data startDate = Date.parse(datefromlwc);

What is the right way to parse the date from date picker.

0

There are 0 best solutions below