Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class BirthDayWishesController {
//This method check for birthday with today's date. If condition get matched then it retues the true.
public static boolean wishTheBirthDay(){
User currentLoggedinUser = [Select id,Date_of_Birth__c from User Where Id =: UserInfo.getUserId() ];
if( currentLoggedinUser.Date_of_Birth__c != null ){
if( == currentLoggedinUser.Date_of_Birth__c.Day() && == currentLoggedinUser.Date_of_Birth__c.Month()){
return true;
return false;
You can’t perform that action at this time.