+ 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(),dToday.day());


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