Solution 1: Create a date newInstance()
and pass the Year, Month and Day from the dateTime.
DateTime dt = System.now(); Date d = Date.newInstance(dt.year(), dt.month(), dt.day()); System.debug('Print Date:' + d);
Solution 2: Get date from the DateTime using Date()
method.
DateTime dt = System.now() Date d = dt.date(); System.debug('Print Date:' + d);