Get Date from DateTime in Apex
Datetime dateWithTime = Datetime.now();
System.debug('dateWithTime ----- ' + dateWithTime);
Date onlyDatefromDateTime = dateWithTime.Date();
System.debug( 'onlyDatefromDateTime ----- ' + String.valueOf(onlyDatefromDateTime));
System.debug('dateWithTime ----- ' + dateWithTime);
Date onlyDatefromDateTime = dateWithTime.Date();
System.debug( 'onlyDatefromDateTime ----- ' + String.valueOf(onlyDatefromDateTime));
Comments
Post a Comment