c# get last day of month
DateTime.DaysInMonth(1980, 08);
c# get last day of month
DateTime.DaysInMonth(1980, 08);
how to get the date of the first day and last day of the week c#
public static DateTime FirstDayOfWeek(DateTime date)
{
DayOfWeek fdow = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;
int offset = fdow - date.DayOfWeek;
DateTime fdowDate = date.AddDays(offset);
return fdowDate;
}
public static DateTime LastDayOfWeek(DateTime date)
{
DateTime ldowDate = FirstDayOfWeek(date).AddDays(6);
return ldowDate;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us