How to get Date from DateTime field using Apex in Salesforce?

Date() is used to get the date from datetime field.


Sample Code:

Datetime LastModifiedDateTime = Datetime.now();  
Date ModifiedDate = LastModifiedDateTime.Date();

No comments:

Post a Comment