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
Wajeed KhanWajeed Khan 

Change the Time value of DateTime field to exact time

Hi Guys,

I need to change the Time value of the DateTime field to the exact time based on the another filed call time having a picklist AM and PM, if it is AM the time value of DateTime is 10:00:00 else 15:00:00 .Any help will be appreciated.

Thanks
Jay GuruswamyJay Guruswamy
        Time myTime = Time.newInstance(10, 0, 0, 0);
        mDateTime    = DateTime.newInstance(myDate, myTime);