Skip to main content
4 of 4
added 12 characters in body
Krishna Bidwai
  • 979
  • 1
  • 10
  • 26

You can use Date.Month() for the the month value, here you will get integer value like 1 for Jan...12 for Dec then from this value you can easily get its quarter. Here is example for you:

Integer quarter = date.today().month()/3;
if(quarter == 0)
    system.debug('==FirstQuarter==';
else if(quarter == 1)
    system.debug('==SecondQuarter==');
else if (quarter == 2)
      system.debug('==ThirdQuarter==');
else 
      system.debug('==fourthQuarter==');

Hope this helps!!!

Regards, Krishna

Krishna Bidwai
  • 979
  • 1
  • 10
  • 26