Answers for "c# get first day and last day of month"

C#
0

c# get last day of month

DateTime.DaysInMonth(1980, 08);
Posted by: Guest on May-27-2021
0

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;
}
Posted by: Guest on November-27-2021

Code answers related to "c# get first day and last day of month"

C# Answers by Framework

Browse Popular Code Answers by Language