ef calculate_dates(original date, now): delta1 = datetime(now.year, original date.month, original date.day) delta2 = datetime(now.year+1, original_date.month, original_date.day) code example
Example: c# find start and end of month from object date
DateTime date = ...
var firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
var lastDayOfMonth = firstDayOfMonth.AddMonths(1).AddDays(-1);