Activity › Forums › Salesforce® Discussions › How to get only Date from the field which is of DateTime type in Salesforce? Tagged: Apex, Datetime, DateTime Type, Salesforce Fields Salesforce® Discussions How to get only Date from the field which is of DateTime type in Salesforce? Posted by Nikita on September 10, 2019 at 1:14 PM How to get only Date from the field which is of DateTime type? Piyush replied 6 years, 8 months ago 2 Members · 1 Reply ApexDatetimeDateTime TypeSalesforce Fields 1 Reply Piyush Member September 11, 2019 at 5:27 AM Hi Nikita, you can use this to get only Date from the field which is of DateTime type in apex:- System.debug('date=' + Date.valueOf(System.now())); Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me