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

how to convert date value to datetime value?

Can u please tell me how to convert a date value to datetime value.
I want to convert startdate(date value) value to datetime value.
Best Answer chosen by Admin (Salesforce Developers) 
Here is a snippet of Apex Code that shows how to take the Year, Month, and Day of a date object and convert it to a dateTime object.

 Date dToday = System.Today();
 Datetime dt = datetime.newInstance(dToday.year(), dToday.month(),;


Message Edited by Drew1815 on 12-17-2008 08:21 AM