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
StaciStaci 

set date/time field to today's date in class

I need to have a date/time field populated with the date/time of now when the class is called.  How do I accomplish this?

Best Answer chosen by Admin (Salesforce Developers) 
Dhaval PanchalDhaval Panchal
Set datetime field wity System.now();

All Answers

Dhaval PanchalDhaval Panchal
Set datetime field wity System.now();
This was selected as the best answer
levaleva

DateTime.now() ?