I need to check if close date of opportunity is equal to current fiscal year in apex.Can someone explain me how to use get current fiscal year.FYI my Org doesn't have custom Fiscal year setup.(Its Standard Fiscal year).
I like this approach better, because it will work in whichever fiscal year setup you're in. It makes use of an SFDC table that is not very well known:
String currentFiscalYear = [SELECT FiscalYearSettings.Name FROM Period WHERE Type = 'Year' AND StartDate <= TODAY AND EndDate >= TODAY].FiscalYearSettings.Name;