Table of Contents

Class DateTimeExtensions

Namespace
GroupeIsa.Neos.Shared.Extensions
Assembly
GroupeIsa.Neos.Shared.dll

Provides extensions methods for the DateTime type.

public static class DateTimeExtensions
Inheritance
DateTimeExtensions
Inherited Members

Methods

EndOfDay(DateTime)

Returns the end of the day for the specified date, changing the time component to 23:59:59.999.

public static DateTime EndOfDay(this DateTime date)

Parameters

date DateTime

The current date.

Returns

DateTime

An DateTime instance that represents the end of the day.

EndOfMonth(DateTime)

Returns the last day of the month of the specified date, changing the time component to 23:59:59.999.

public static DateTime EndOfMonth(this DateTime date)

Parameters

date DateTime

The current date.

Returns

DateTime

An DateTime instance that represents the last day of the month.

EndOfWeek(DateTime)

Returns the last day of the week of the specified date, changing the time component to 23:59:59.999.

public static DateTime EndOfWeek(this DateTime date)

Parameters

date DateTime

The current date.

Returns

DateTime

An DateTime instance that represents the last day of the week.

EndOfWeek(DateTime, DayOfWeek)

Returns the last day of the week of the specified date, changing the time component to 23:59:59.999.

public static DateTime EndOfWeek(this DateTime date, DayOfWeek firstDayOfWeek)

Parameters

date DateTime

The current date.

firstDayOfWeek DayOfWeek

The first day of the week.

Returns

DateTime

An DateTime instance that represents the last day of the week.

EndOfYear(DateTime)

Returns the last day of the year of the specified date, changing the time component to 23:59:59.999.

public static DateTime EndOfYear(this DateTime date)

Parameters

date DateTime

The current date.

Returns

DateTime

An DateTime instance that represents the last day of the year.

StartOfDay(DateTime)

Returns the beginning of the day for the specified date, changing the time component to 00:00:00.000.

public static DateTime StartOfDay(this DateTime date)

Parameters

date DateTime

The current date.

Returns

DateTime

An DateTime instance that represents the start of the day.

StartOfMonth(DateTime)

Returns the first day of the month of the specified date, changing the time component to 00:00:00.000.

public static DateTime StartOfMonth(this DateTime date)

Parameters

date DateTime

The current date.

Returns

DateTime

An DateTime instance that represents the first day of the month.

StartOfWeek(DateTime)

Returns the first day of the week of the specified date, changing the time component to 00:00:00.000.

public static DateTime StartOfWeek(this DateTime date)

Parameters

date DateTime

The current date.

Returns

DateTime

An DateTime instance that represents the first day of the week.

StartOfWeek(DateTime, DayOfWeek)

Returns the first day of the week of the specified date, changing the time component to 00:00:00.000.

public static DateTime StartOfWeek(this DateTime date, DayOfWeek firstDayOfWeek)

Parameters

date DateTime

The current date.

firstDayOfWeek DayOfWeek

The first day of the week.

Returns

DateTime

An DateTime instance that represents the first day of the week.

StartOfYear(DateTime)

Returns the first day of the year of the specified date, changing the time component to 00:00:00.000.

public static DateTime StartOfYear(this DateTime date)

Parameters

date DateTime

The current date.

Returns

DateTime

An DateTime instance that represents the first day of the year.