I look through the documentation and didn’t see a system method that converts a date time field to a date. There is one for formula fields but is there one for Apex?
Solution : Just create a date newInstance() and pass in just the year,month,day from the dateTime object.
Datetime dateTimetemp = System.now();
Date dateTemp = Date.newInstance(dateTimetemp.year(),dateTimetemp.month(),dateTimetemp.day());
Recent Comments