DateTime dt1 = DateTime.Now.Date; DateTime dt2 = dt1.Date.AddDays(-1* (dt1.Day - 1));
// format string to format the date like you need it String formatString = "dd/MM/yyyy"; DateTime now = DateTime.Now; DateTime date = new DateTime(now.Year, now.Month, 1); // create a date with current year and month and day 1 textBox1.Text = date.ToString(formatString); textBox2.Text = now.ToString(formatString);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)