EasyAF_DateTimeExtensions

Extensions on and .

Syntax

public static class EasyAF_DateTimeExtensions

Inheritance

Methods

DaysInMonth

public static int DaysInMonth(this DateTime value)

Parameters

Returns

int

DaysInMonth

public static int DaysInMonth(this DateTimeOffset value)

Parameters

Returns

int

FirstDayOfMonth

public static DateTime FirstDayOfMonth(this DateTime value)

Parameters

Returns

DateTime

FirstDayOfMonth

public static DateTimeOffset FirstDayOfMonth(this DateTimeOffset value)

Parameters

Returns

DateTimeOffset

GetQuarter

public static int GetQuarter(this DateTime date, DateTime fiscalYearStart)
Calculates the quarter for the given , assuming a the provided fiscal year begin date.

Parameters

  • date DateTime: The to use in the calculation.
  • fiscalYearStart DateTime: The representing the start day of the fiscal year to use in calculation.

Returns

int

GetQuarter

public static int GetQuarter(this DateTime date)
Calculates the quarter for the given , assuming a calendar-based fiscal year.

Parameters

  • date DateTime: The to use in the calculation.

Returns

int

GetQuarter

public static int GetQuarter(this DateTimeOffset date, DateTimeOffset fiscalYearStart)
Calculates the quarter for the given , assuming a the provided fiscal year begin date.

Parameters

  • date DateTimeOffset: The to use in the calculation.
  • fiscalYearStart DateTimeOffset: The representing the start day of the fiscal year to use in calculation.

Returns

int

GetQuarter

public static int GetQuarter(this DateTimeOffset date)
Calculates the quarter for the given , assuming a calendar-based fiscal year.

Parameters

Returns

int

LastDayOfMonth

public static DateTime LastDayOfMonth(this DateTime value)

Parameters

Returns

DateTime

LastDayOfMonth

public static DateTimeOffset LastDayOfMonth(this DateTimeOffset value)

Parameters

Returns

DateTimeOffset