Get Start(first) Date for a week, month and quarter utility functions

Common Date Time utility functions for figuring out start (first) dates


public static DateTime GetWeekStartDate(DateTime dDate)        {
DayOfWeek day = dDate.DayOfWeek;

int days = day – DayOfWeek.Sunday;

DateTime start = dDate.AddDays(-days);

return start;



public static DateTime GetMonthStartDate(DateTime dDate)

int month = dDate.Month;
DateTime start = new DateTime(dDate.Year, month, 1);

return start;


public static DateTime GetQuarterStartDate(DateTime date)
int intQuarterNum = (date.Month – 1) / 3 + 1;

return new DateTime(date.Year, 3 * intQuarterNum – 2, 1);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: