For starting Date
int month = DateTime.Now.Month; int year = DateTime.Now.Year; // if month is october or later, the FY started 10-1 of this year // else it started 10-1 of last year return month > 9 ? new DateTime( year, 10, 1 ) : new DateTime( year - 1, 10, 1 );
For Ending Date
// get the current month and year int month = DateTime.Now.Month; int year = DateTime.Now.Year; // if month is october or later, the FY ends 9/30 next year // else it ends 9-30 of this year return month > 9 ? new DateTime( year + 1, 9, 30 ) : new DateTime( year, 9, 30 );