Get Day of Today

date intNoofDays ; 
 intNoofDays = system.today(); 
Output: intNoofDays__ 2014-09-25 00:00:00 
 system.debug('intNoofDays__'+intNoofDays); 
 Datetime dt = DateTime.newInstance(intNoofDays, 
Time.newInstance(0, 0, 0, 0)); 
 Output: dt___2014-09-24 18:30:00 
 system.debug('dt___'+dt); 
 String strTodayDayName = dt.format('EEEE'); 
 System.debug('Day : ' + strTodayDayName); 
 Output: Day : Thursday

Comments

Popular posts from this blog

Salesforce Spring 16 Release Exam (Maintenance Exam Q&A) for Developer 201 Admin

Show Hyper Link On Add Error in Salesforce Trigger

Show the Success Message before Redirecting the Detail page on Visualforce Page