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());
Thanks a trillion mate for the solution !!
Hi,
It’s still giving time stamp but with all zeros. 00:00:00 can you please tell me how can I get rid of the time?
Neer mind got the solution
http://paulforce.wordpress.com/2009/08/27/formatting-time-in-apex/
Thanks for giving good solution bro.
Priya, Can you tell what is the solution here