Get Current Financial Year in C#

public static string GetCurrentFinancialYear()
{

int CurrentYear = DateTime.Today.Year;
int PreviousYear = DateTime.Today.Year – 1;
int NextYear = DateTime.Today.Year + 1;
string PreYear = PreviousYear.ToString();
string NexYear = NextYear.ToString();
string CurYear = CurrentYear.ToString();
string FinYear = null;

if (DateTime.Today.Month > 3)

FinYear = CurYear + “-” + NexYear;

else

FinYear = PreYear + “-” + CurYear;

return FinYear.Trim();

}

Posts Tagged with…

Write a Comment

Your email address will not be published. Required fields are marked *