C# 클래스 NSupport.DateTimeCalculations

Provides extension methods for DateTime for calcualtions.
파일 보기 프로젝트 열기: jittuu/NSupport

공개 메소드들

메소드 설명
Advance ( this source, int years, int months, int days, int hours, int minutes, int seconds ) : System.DateTime

Returns a new System.DateTime that adds the provided parameters (years, months, days, hours, minutes, seconds) value/s.

Ago ( this source, int years, int months, int days, int hours, int minutes, int seconds ) : System.DateTime

Returns a new System.DateTime that minus the provided parameters (years, months, days, hours, minutes, seconds) value/s.

BeginningOfDay ( this source ) : System.DateTime

Returns a new System.DateTime with the time value set to 12:00:00 midnight (00:00:00).

BeginningOfMonth ( this source ) : System.DateTime

Returns the first day of the current month with the time value set to 12:00:00 midnight (00:00:00).

BeginningOfQuarter ( this source ) : System.DateTime

Returns a new System.DateTime representing the start of the current quarter (1st of January, April, July, October) with the time value set to 12:00:00 midnight (00:00:00).

BeginningOfWeek ( this source ) : System.DateTime

Returns the first day of the current week with the time value set to 12:00:00 midnight (00:00:00). This method is culture-aware method which calculates based on System.Globalization.DateTimeFormatInfo.FirstDayOfWeek.

BeginningOfYear ( this source ) : System.DateTime

Returns the first day of the current year with the time value set to 12:00:00 midnight (00:00:00).

Change ( this source, int years = null, int months = null, int days = null, int hours = null, int minutes = null, int seconds = null, int milliseconds = null ) : System.DateTime

Returns a new System.DateTime that change the provided parameters (years, months, days, hours, minutes, seconds, milliseconds) value/s.

EndOfDay ( this source ) : System.DateTime

Returns a new System.DateTime with the time value set to (23:59:59).

EndOfMonth ( this source ) : System.DateTime

Returns the last day of the current month with the time value set to (23:59:59).

EndOfQuarter ( this source ) : System.DateTime

Returns a new System.DateTime representing the end of the current quarter (last day of March, June, September, December) with the time value set to (23:59:59).

EndOfWeek ( this source ) : System.DateTime

Returns the last day of the current week with the time value set to (23:59:59). This method is culture-aware method which calculates based on System.Globalization.DateTimeFormatInfo.FirstDayOfWeek.

EndOfYear ( this source ) : System.DateTime

Returns the last day of the current year with the time value set to (23:59:59).

IsFuture ( this source ) : bool

Returns true if the instance System.DateTime is greater than System.DateTime.Now, otherwise false.

IsPast ( this source ) : bool

Returns true if the instance System.DateTime is less than System.DateTime.Now, otherwise false.

IsToday ( this source ) : bool

Returns true if the instance System.DateTime is today regardless of time, otherwise false.

Midnight ( this source ) : System.DateTime

Returns a new System.DateTime with the time value set to 12:00:00 midnight (00:00:00).

NextMonth ( this source ) : System.DateTime

Returns a new System.DateTime that adds one month to the value of this instance.

NextWeek ( this source ) : System.DateTime

Returns a new System.DateTime that adds seven days to the value of this instance with the time value set to 12:00:00 midnight (00:00:00).

NextWeek ( this source, DayOfWeek day ) : System.DateTime

Returns the given day of next week with the time value set to 12:00:00 midnight (00:00:00). This method is culture-aware method which calculates based on System.Globalization.DateTimeFormatInfo.FirstDayOfWeek.

NextYear ( this source ) : System.DateTime

Returns a new System.DateTime that adds one year to the value of this instance.

PreviousMonth ( this source ) : System.DateTime

Returns a new System.DateTime that minus one month to the value of this instance.

PreviousYear ( this source ) : System.DateTime

Returns a new System.DateTime that minus one year to the value of this instance.

Tomorrow ( this source ) : System.DateTime

Returns a new System.DateTime that adds one day to the value of this instance.

Yesterday ( this source ) : System.DateTime

Returns a new System.DateTime that minus one day to the value of this instance.

메소드 상세

Advance() 공개 정적인 메소드

Returns a new System.DateTime that adds the provided parameters (years, months, days, hours, minutes, seconds) value/s.
public static Advance ( this source, int years, int months, int days, int hours, int minutes, int seconds ) : System.DateTime
source this instance.
years int The number of years to add.
months int The number of months to add.
days int The number of days to add.
hours int The number of hours to add.
minutes int The number of minutes to add.
seconds int The number of seconds to add.
리턴 System.DateTime

Ago() 공개 정적인 메소드

Returns a new System.DateTime that minus the provided parameters (years, months, days, hours, minutes, seconds) value/s.
public static Ago ( this source, int years, int months, int days, int hours, int minutes, int seconds ) : System.DateTime
source this instance.
years int The number of years to reduce.
months int The number of months to reduce.
days int The number of days to reduce.
hours int The number of hours to reduce.
minutes int The number of minutes to reduce.
seconds int The number of seconds to reduce.
리턴 System.DateTime

BeginningOfDay() 공개 정적인 메소드

Returns a new System.DateTime with the time value set to 12:00:00 midnight (00:00:00).
public static BeginningOfDay ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

BeginningOfMonth() 공개 정적인 메소드

Returns the first day of the current month with the time value set to 12:00:00 midnight (00:00:00).
public static BeginningOfMonth ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

BeginningOfQuarter() 공개 정적인 메소드

Returns a new System.DateTime representing the start of the current quarter (1st of January, April, July, October) with the time value set to 12:00:00 midnight (00:00:00).
public static BeginningOfQuarter ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

BeginningOfWeek() 공개 정적인 메소드

Returns the first day of the current week with the time value set to 12:00:00 midnight (00:00:00). This method is culture-aware method which calculates based on System.Globalization.DateTimeFormatInfo.FirstDayOfWeek.
public static BeginningOfWeek ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

BeginningOfYear() 공개 정적인 메소드

Returns the first day of the current year with the time value set to 12:00:00 midnight (00:00:00).
public static BeginningOfYear ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

Change() 공개 정적인 메소드

Returns a new System.DateTime that change the provided parameters (years, months, days, hours, minutes, seconds, milliseconds) value/s.
public static Change ( this source, int years = null, int months = null, int days = null, int hours = null, int minutes = null, int seconds = null, int milliseconds = null ) : System.DateTime
source this instance.
years int The number of years to change.
months int The number of months to change.
days int The number of days to change.
hours int The number of hours to change.
minutes int The number of minutes to change.
seconds int The number of seconds to change.
milliseconds int The number of milliseconds to change.
리턴 System.DateTime

EndOfDay() 공개 정적인 메소드

Returns a new System.DateTime with the time value set to (23:59:59).
public static EndOfDay ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

EndOfMonth() 공개 정적인 메소드

Returns the last day of the current month with the time value set to (23:59:59).
public static EndOfMonth ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

EndOfQuarter() 공개 정적인 메소드

Returns a new System.DateTime representing the end of the current quarter (last day of March, June, September, December) with the time value set to (23:59:59).
public static EndOfQuarter ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

EndOfWeek() 공개 정적인 메소드

Returns the last day of the current week with the time value set to (23:59:59). This method is culture-aware method which calculates based on System.Globalization.DateTimeFormatInfo.FirstDayOfWeek.
public static EndOfWeek ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

EndOfYear() 공개 정적인 메소드

Returns the last day of the current year with the time value set to (23:59:59).
public static EndOfYear ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

IsFuture() 공개 정적인 메소드

Returns true if the instance System.DateTime is greater than System.DateTime.Now, otherwise false.
public static IsFuture ( this source ) : bool
source this instance.
리턴 bool

IsPast() 공개 정적인 메소드

Returns true if the instance System.DateTime is less than System.DateTime.Now, otherwise false.
public static IsPast ( this source ) : bool
source this instance.
리턴 bool

IsToday() 공개 정적인 메소드

Returns true if the instance System.DateTime is today regardless of time, otherwise false.
public static IsToday ( this source ) : bool
source this instance.
리턴 bool

Midnight() 공개 정적인 메소드

Returns a new System.DateTime with the time value set to 12:00:00 midnight (00:00:00).
public static Midnight ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

NextMonth() 공개 정적인 메소드

Returns a new System.DateTime that adds one month to the value of this instance.
public static NextMonth ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

NextWeek() 공개 정적인 메소드

Returns a new System.DateTime that adds seven days to the value of this instance with the time value set to 12:00:00 midnight (00:00:00).
public static NextWeek ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

NextWeek() 공개 정적인 메소드

Returns the given day of next week with the time value set to 12:00:00 midnight (00:00:00). This method is culture-aware method which calculates based on System.Globalization.DateTimeFormatInfo.FirstDayOfWeek.
public static NextWeek ( this source, DayOfWeek day ) : System.DateTime
source this instance.
day DayOfWeek The of next week.
리턴 System.DateTime

NextYear() 공개 정적인 메소드

Returns a new System.DateTime that adds one year to the value of this instance.
public static NextYear ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

PreviousMonth() 공개 정적인 메소드

Returns a new System.DateTime that minus one month to the value of this instance.
public static PreviousMonth ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

PreviousYear() 공개 정적인 메소드

Returns a new System.DateTime that minus one year to the value of this instance.
public static PreviousYear ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

Tomorrow() 공개 정적인 메소드

Returns a new System.DateTime that adds one day to the value of this instance.
public static Tomorrow ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime

Yesterday() 공개 정적인 메소드

Returns a new System.DateTime that minus one day to the value of this instance.
public static Yesterday ( this source ) : System.DateTime
source this instance.
리턴 System.DateTime