function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KeerthigeeKeerthigee 

Format for inserting date using Apex

Hi All,

    I want to insert date from backend.For this,I want to know date format.

I tried this YYYY-MM-DD.But I am getting error..

Can anyone help me??

Kindly support and suggest.

Thanks.
Best Answer chosen by Keerthigee
bob_buzzardbob_buzzard
What are you inserting here?  If its a date field you should construct a new date using date.newinstance() - can you post your code?

All Answers

bob_buzzardbob_buzzard
What are you inserting here?  If its a date field you should construct a new date using date.newinstance() - can you post your code?
This was selected as the best answer
KeerthigeeKeerthigee
Hi,

Thank you for your suggestion which is helpful.

Using Date.newinstance(), I resolved my error.

Thanks.