C# 클래스 FluentDateTime.DateTimeExtensions

Static class containing Fluent DateTime extension methods.
파일 보기 프로젝트 열기: FluentDateTime/FluentDateTime

공개 메소드들

메소드 설명
AddBusinessDays ( this current, int days ) : System.DateTime

Adds the given number of business days to the DateTime.

At ( this current, int hour, int minute ) : System.DateTime

Returns the given DateTime with hour and minutes set At given values.

At ( this current, int hour, int minute, int second ) : System.DateTime

Returns the given DateTime with hour and minutes and seconds set At given values.

At ( this current, int hour, int minute, int second, int milliseconds ) : System.DateTime

Returns the given DateTime with hour and minutes and seconds and milliseconds set At given values.

BeginningOfDay ( this date ) : System.DateTime

Returns the Start of the given day (the first millisecond of the given DateTime).

BeginningOfDay ( this date, int timezoneOffset ) : System.DateTime

Returns the timezone-adjusted Start of the given day (the first millisecond of the given DateTime).

DecreaseTime ( this startDate, System.TimeSpan toSubtract ) : System.DateTime

Decreases the DateTime object with given TimeSpan value.

EndOfDay ( this date ) : System.DateTime

Returns the very end of the given day (the last millisecond of the last hour for the given DateTime).

EndOfDay ( this date, int timeZoneOffset ) : System.DateTime

Returns the timezone-adjusted very end of the given day (the last millisecond of the last hour for the given DateTime).

FirstDayOfMonth ( this current ) : System.DateTime

Sets the day of the DateTime to the first day in that month.

FirstDayOfQuarter ( this current ) : System.DateTime

Sets the day of the DateTime to the first day in that calendar quarter. credit to http://www.devcurry.com/2009/05/find-first-and-last-day-of-current.html

FirstDayOfWeek ( this dateTime ) : System.DateTime

Returns a DateTime adjusted to the beginning of the week.

the beginning of the week is controlled by the current Culture

FirstDayOfYear ( this current ) : System.DateTime

Returns the first day of the year keeping the time component intact. Eg, 2011-02-04T06:40:20.005 => 2011-01-01T06:40:20.005

IncreaseTime ( this startDate, System.TimeSpan toAdd ) : System.DateTime

Increases the DateTime object with given TimeSpan value.

IsAfter ( this current, System.DateTime toCompareWith ) : bool

Determines whether the specified DateTime value is After then current value.

IsBefore ( this current, System.DateTime toCompareWith ) : bool

Determines whether the specified DateTime is before then current value.

IsInFuture ( this dateTime ) : bool

Determine if a DateTime is in the future.

IsInPast ( this dateTime ) : bool

Determine if a DateTime is in the past.

LastDayOfMonth ( this current ) : System.DateTime

Sets the day of the DateTime to the last day in that month.

LastDayOfQuarter ( this current ) : System.DateTime

Sets the day of the DateTime to the last day in that calendar quarter. credit to http://www.devcurry.com/2009/05/find-first-and-last-day-of-current.html

LastDayOfWeek ( this current ) : System.DateTime

Returns the last day of the week keeping the time component intact. Eg, 2011-12-24T06:40:20.005 => 2011-12-25T06:40:20.005

LastDayOfYear ( this current ) : System.DateTime

Returns the last day of the year keeping the time component intact. Eg, 2011-12-24T06:40:20.005 => 2011-12-31T06:40:20.005

Midnight ( this value ) : System.DateTime

Returns original DateTime value with time part set to midnight (alias for BeginningOfDay method).

Next ( this start, DayOfWeek day ) : System.DateTime

Returns first next occurrence of specified DayOfWeek.

NextDay ( this start ) : System.DateTime

Returns DateTime increased by 24 hours ie Next Day.

NextMonth ( this current ) : System.DateTime

Returns the next month keeping the time component intact. Eg, 2012-12-05T06:40:20.005 => 2013-01-05T06:40:20.005 If the next month doesn't have that many days the last day of the next month is used. Eg, 2013-01-31T06:40:20.005 => 2013-02-28T06:40:20.005

NextYear ( this start ) : System.DateTime

Returns the same date (same Day, Month, Hour, Minute, Second etc) in the next calendar year. If that day does not exist in next year in same month, number of missing days is added to the last day in same month next year.

Noon ( this value ) : System.DateTime

Returns original DateTime value with time part set to Noon (12:00:00h).

Previous ( this start, DayOfWeek day ) : System.DateTime

Returns first next occurrence of specified DayOfWeek.

PreviousDay ( this start ) : System.DateTime

Returns DateTime decreased by 24h period ie Previous Day.

PreviousMonth ( this current ) : System.DateTime

Returns the previous month keeping the time component intact. Eg, 2010-01-20T06:40:20.005 => 2009-12-20T06:40:20.005 If the previous month doesn't have that many days the last day of the previous month is used. Eg, 2009-03-31T06:40:20.005 => 2009-02-28T06:40:20.005

PreviousYear ( this start ) : System.DateTime

Returns the same date (same Day, Month, Hour, Minute, Second etc) in the previous calendar year. If that day does not exist in previous year in same month, number of missing days is added to the last day in same month previous year.

Round ( this dateTime, RoundTo rt ) : System.DateTime
SameDay ( this current, System.DateTime date ) : bool

Determines whether the specified DateTime value is exactly the same day (day + month + year) then current

SameMonth ( this current, System.DateTime date ) : bool

Determines whether the specified DateTime value is exactly the same month (month + year) then current. Eg, 2015-12-01 and 2014-12-01 => False

SameYear ( this current, System.DateTime date ) : bool

Determines whether the specified DateTime value is exactly the same year then current. Eg, 2015-12-01 and 2015-01-01 => True

SetDate ( this value, int year ) : System.DateTime

Returns DateTime with changed Year part.

SetDate ( this value, int year, int month ) : System.DateTime

Returns DateTime with changed Year and Month part.

SetDate ( this value, int year, int month, int day ) : System.DateTime

Returns DateTime with changed Year, Month and Day part.

SetDay ( this value, int day ) : System.DateTime

Returns DateTime with changed Day part.

SetHour ( this originalDate, int hour ) : System.DateTime

Returns DateTime with changed Hour part.

SetMillisecond ( this originalDate, int millisecond ) : System.DateTime

Returns DateTime with changed Millisecond part.

SetMinute ( this originalDate, int minute ) : System.DateTime

Returns DateTime with changed Minute part.

SetMonth ( this value, int month ) : System.DateTime

Returns DateTime with changed Month part.

SetSecond ( this originalDate, int second ) : System.DateTime

Returns DateTime with changed Second part.

SetTime ( this originalDate, int hour ) : System.DateTime

Returns the original DateTime with Hour part changed to supplied hour parameter.

SetTime ( this originalDate, int hour, int minute ) : System.DateTime

Returns the original DateTime with Hour and Minute parts changed to supplied hour and minute parameters.

SetTime ( this originalDate, int hour, int minute, int second ) : System.DateTime

Returns the original DateTime with Hour, Minute and Second parts changed to supplied hour, minute and second parameters.

SetTime ( this originalDate, int hour, int minute, int second, int millisecond ) : System.DateTime

Returns the original DateTime with Hour, Minute, Second and Millisecond parts changed to supplied hour, minute, second and millisecond parameters.

SetYear ( this value, int year ) : System.DateTime

Returns DateTime with changed Year part.

SubtractBusinessDays ( this current, int days ) : System.DateTime

Subtracts the given number of business days to the DateTime.

WeekAfter ( this start ) : System.DateTime

Increases supplied DateTime for 7 days ie returns the Next Week.

WeekEarlier ( this start ) : System.DateTime

Decreases supplied DateTime for 7 days ie returns the Previous Week.

비공개 메소드들

메소드 설명
StartOfWeek ( this dateTime ) : System.DateTime

메소드 상세

AddBusinessDays() 공개 정적인 메소드

Adds the given number of business days to the DateTime.
public static AddBusinessDays ( this current, int days ) : System.DateTime
current this The date to be changed.
days int Number of business days to be added.
리턴 System.DateTime

At() 공개 정적인 메소드

Returns the given DateTime with hour and minutes set At given values.
public static At ( this current, int hour, int minute ) : System.DateTime
current this The current to be changed.
hour int The hour to set time to.
minute int The minute to set time to.
리턴 System.DateTime

At() 공개 정적인 메소드

Returns the given DateTime with hour and minutes and seconds set At given values.
public static At ( this current, int hour, int minute, int second ) : System.DateTime
current this The current to be changed.
hour int The hour to set time to.
minute int The minute to set time to.
second int The second to set time to.
리턴 System.DateTime

At() 공개 정적인 메소드

Returns the given DateTime with hour and minutes and seconds and milliseconds set At given values.
public static At ( this current, int hour, int minute, int second, int milliseconds ) : System.DateTime
current this The current to be changed.
hour int The hour to set time to.
minute int The minute to set time to.
second int The second to set time to.
milliseconds int The milliseconds to set time to.
리턴 System.DateTime

BeginningOfDay() 공개 정적인 메소드

Returns the Start of the given day (the first millisecond of the given DateTime).
public static BeginningOfDay ( this date ) : System.DateTime
date this
리턴 System.DateTime

BeginningOfDay() 공개 정적인 메소드

Returns the timezone-adjusted Start of the given day (the first millisecond of the given DateTime).
public static BeginningOfDay ( this date, int timezoneOffset ) : System.DateTime
date this
timezoneOffset int
리턴 System.DateTime

DecreaseTime() 공개 정적인 메소드

Decreases the DateTime object with given TimeSpan value.
public static DecreaseTime ( this startDate, System.TimeSpan toSubtract ) : System.DateTime
startDate this
toSubtract System.TimeSpan
리턴 System.DateTime

EndOfDay() 공개 정적인 메소드

Returns the very end of the given day (the last millisecond of the last hour for the given DateTime).
public static EndOfDay ( this date ) : System.DateTime
date this
리턴 System.DateTime

EndOfDay() 공개 정적인 메소드

Returns the timezone-adjusted very end of the given day (the last millisecond of the last hour for the given DateTime).
public static EndOfDay ( this date, int timeZoneOffset ) : System.DateTime
date this
timeZoneOffset int
리턴 System.DateTime

FirstDayOfMonth() 공개 정적인 메소드

Sets the day of the DateTime to the first day in that month.
public static FirstDayOfMonth ( this current ) : System.DateTime
current this The current to be changed.
리턴 System.DateTime

FirstDayOfQuarter() 공개 정적인 메소드

Sets the day of the DateTime to the first day in that calendar quarter. credit to http://www.devcurry.com/2009/05/find-first-and-last-day-of-current.html
public static FirstDayOfQuarter ( this current ) : System.DateTime
current this
리턴 System.DateTime

FirstDayOfWeek() 공개 정적인 메소드

Returns a DateTime adjusted to the beginning of the week.
the beginning of the week is controlled by the current Culture
public static FirstDayOfWeek ( this dateTime ) : System.DateTime
dateTime this The DateTime to adjust
리턴 System.DateTime

FirstDayOfYear() 공개 정적인 메소드

Returns the first day of the year keeping the time component intact. Eg, 2011-02-04T06:40:20.005 => 2011-01-01T06:40:20.005
public static FirstDayOfYear ( this current ) : System.DateTime
current this The DateTime to adjust
리턴 System.DateTime

IncreaseTime() 공개 정적인 메소드

Increases the DateTime object with given TimeSpan value.
public static IncreaseTime ( this startDate, System.TimeSpan toAdd ) : System.DateTime
startDate this
toAdd System.TimeSpan
리턴 System.DateTime

IsAfter() 공개 정적인 메소드

Determines whether the specified DateTime value is After then current value.
public static IsAfter ( this current, System.DateTime toCompareWith ) : bool
current this The current value.
toCompareWith System.DateTime Value to compare with.
리턴 bool

IsBefore() 공개 정적인 메소드

Determines whether the specified DateTime is before then current value.
public static IsBefore ( this current, System.DateTime toCompareWith ) : bool
current this The current value.
toCompareWith System.DateTime Value to compare with.
리턴 bool

IsInFuture() 공개 정적인 메소드

Determine if a DateTime is in the future.
public static IsInFuture ( this dateTime ) : bool
dateTime this The date to be checked.
리턴 bool

IsInPast() 공개 정적인 메소드

Determine if a DateTime is in the past.
public static IsInPast ( this dateTime ) : bool
dateTime this The date to be checked.
리턴 bool

LastDayOfMonth() 공개 정적인 메소드

Sets the day of the DateTime to the last day in that month.
public static LastDayOfMonth ( this current ) : System.DateTime
current this The current DateTime to be changed.
리턴 System.DateTime

LastDayOfQuarter() 공개 정적인 메소드

Sets the day of the DateTime to the last day in that calendar quarter. credit to http://www.devcurry.com/2009/05/find-first-and-last-day-of-current.html
public static LastDayOfQuarter ( this current ) : System.DateTime
current this
리턴 System.DateTime

LastDayOfWeek() 공개 정적인 메소드

Returns the last day of the week keeping the time component intact. Eg, 2011-12-24T06:40:20.005 => 2011-12-25T06:40:20.005
public static LastDayOfWeek ( this current ) : System.DateTime
current this The DateTime to adjust
리턴 System.DateTime

LastDayOfYear() 공개 정적인 메소드

Returns the last day of the year keeping the time component intact. Eg, 2011-12-24T06:40:20.005 => 2011-12-31T06:40:20.005
public static LastDayOfYear ( this current ) : System.DateTime
current this The DateTime to adjust
리턴 System.DateTime

Midnight() 공개 정적인 메소드

Returns original DateTime value with time part set to midnight (alias for BeginningOfDay method).
public static Midnight ( this value ) : System.DateTime
value this
리턴 System.DateTime

Next() 공개 정적인 메소드

Returns first next occurrence of specified DayOfWeek.
public static Next ( this start, DayOfWeek day ) : System.DateTime
start this
day DayOfWeek
리턴 System.DateTime

NextDay() 공개 정적인 메소드

Returns DateTime increased by 24 hours ie Next Day.
public static NextDay ( this start ) : System.DateTime
start this
리턴 System.DateTime

NextMonth() 공개 정적인 메소드

Returns the next month keeping the time component intact. Eg, 2012-12-05T06:40:20.005 => 2013-01-05T06:40:20.005 If the next month doesn't have that many days the last day of the next month is used. Eg, 2013-01-31T06:40:20.005 => 2013-02-28T06:40:20.005
public static NextMonth ( this current ) : System.DateTime
current this The DateTime to adjust
리턴 System.DateTime

NextYear() 공개 정적인 메소드

Returns the same date (same Day, Month, Hour, Minute, Second etc) in the next calendar year. If that day does not exist in next year in same month, number of missing days is added to the last day in same month next year.
public static NextYear ( this start ) : System.DateTime
start this
리턴 System.DateTime

Noon() 공개 정적인 메소드

Returns original DateTime value with time part set to Noon (12:00:00h).
public static Noon ( this value ) : System.DateTime
value this The find Noon for.
리턴 System.DateTime

Previous() 공개 정적인 메소드

Returns first next occurrence of specified DayOfWeek.
public static Previous ( this start, DayOfWeek day ) : System.DateTime
start this
day DayOfWeek
리턴 System.DateTime

PreviousDay() 공개 정적인 메소드

Returns DateTime decreased by 24h period ie Previous Day.
public static PreviousDay ( this start ) : System.DateTime
start this
리턴 System.DateTime

PreviousMonth() 공개 정적인 메소드

Returns the previous month keeping the time component intact. Eg, 2010-01-20T06:40:20.005 => 2009-12-20T06:40:20.005 If the previous month doesn't have that many days the last day of the previous month is used. Eg, 2009-03-31T06:40:20.005 => 2009-02-28T06:40:20.005
public static PreviousMonth ( this current ) : System.DateTime
current this The DateTime to adjust
리턴 System.DateTime

PreviousYear() 공개 정적인 메소드

Returns the same date (same Day, Month, Hour, Minute, Second etc) in the previous calendar year. If that day does not exist in previous year in same month, number of missing days is added to the last day in same month previous year.
public static PreviousYear ( this start ) : System.DateTime
start this
리턴 System.DateTime

Round() 공개 정적인 메소드

public static Round ( this dateTime, RoundTo rt ) : System.DateTime
dateTime this
rt RoundTo
리턴 System.DateTime

SameDay() 공개 정적인 메소드

Determines whether the specified DateTime value is exactly the same day (day + month + year) then current
public static SameDay ( this current, System.DateTime date ) : bool
current this The current value
date System.DateTime Value to compare with
리턴 bool

SameMonth() 공개 정적인 메소드

Determines whether the specified DateTime value is exactly the same month (month + year) then current. Eg, 2015-12-01 and 2014-12-01 => False
public static SameMonth ( this current, System.DateTime date ) : bool
current this The current value
date System.DateTime Value to compare with
리턴 bool

SameYear() 공개 정적인 메소드

Determines whether the specified DateTime value is exactly the same year then current. Eg, 2015-12-01 and 2015-01-01 => True
public static SameYear ( this current, System.DateTime date ) : bool
current this The current value
date System.DateTime Value to compare with
리턴 bool

SetDate() 공개 정적인 메소드

Returns DateTime with changed Year part.
public static SetDate ( this value, int year ) : System.DateTime
value this
year int
리턴 System.DateTime

SetDate() 공개 정적인 메소드

Returns DateTime with changed Year and Month part.
public static SetDate ( this value, int year, int month ) : System.DateTime
value this
year int
month int
리턴 System.DateTime

SetDate() 공개 정적인 메소드

Returns DateTime with changed Year, Month and Day part.
public static SetDate ( this value, int year, int month, int day ) : System.DateTime
value this
year int
month int
day int
리턴 System.DateTime

SetDay() 공개 정적인 메소드

Returns DateTime with changed Day part.
public static SetDay ( this value, int day ) : System.DateTime
value this
day int
리턴 System.DateTime

SetHour() 공개 정적인 메소드

Returns DateTime with changed Hour part.
public static SetHour ( this originalDate, int hour ) : System.DateTime
originalDate this
hour int
리턴 System.DateTime

SetMillisecond() 공개 정적인 메소드

Returns DateTime with changed Millisecond part.
public static SetMillisecond ( this originalDate, int millisecond ) : System.DateTime
originalDate this
millisecond int
리턴 System.DateTime

SetMinute() 공개 정적인 메소드

Returns DateTime with changed Minute part.
public static SetMinute ( this originalDate, int minute ) : System.DateTime
originalDate this
minute int
리턴 System.DateTime

SetMonth() 공개 정적인 메소드

Returns DateTime with changed Month part.
public static SetMonth ( this value, int month ) : System.DateTime
value this
month int
리턴 System.DateTime

SetSecond() 공개 정적인 메소드

Returns DateTime with changed Second part.
public static SetSecond ( this originalDate, int second ) : System.DateTime
originalDate this
second int
리턴 System.DateTime

SetTime() 공개 정적인 메소드

Returns the original DateTime with Hour part changed to supplied hour parameter.
public static SetTime ( this originalDate, int hour ) : System.DateTime
originalDate this
hour int
리턴 System.DateTime

SetTime() 공개 정적인 메소드

Returns the original DateTime with Hour and Minute parts changed to supplied hour and minute parameters.
public static SetTime ( this originalDate, int hour, int minute ) : System.DateTime
originalDate this
hour int
minute int
리턴 System.DateTime

SetTime() 공개 정적인 메소드

Returns the original DateTime with Hour, Minute and Second parts changed to supplied hour, minute and second parameters.
public static SetTime ( this originalDate, int hour, int minute, int second ) : System.DateTime
originalDate this
hour int
minute int
second int
리턴 System.DateTime

SetTime() 공개 정적인 메소드

Returns the original DateTime with Hour, Minute, Second and Millisecond parts changed to supplied hour, minute, second and millisecond parameters.
public static SetTime ( this originalDate, int hour, int minute, int second, int millisecond ) : System.DateTime
originalDate this
hour int
minute int
second int
millisecond int
리턴 System.DateTime

SetYear() 공개 정적인 메소드

Returns DateTime with changed Year part.
public static SetYear ( this value, int year ) : System.DateTime
value this
year int
리턴 System.DateTime

SubtractBusinessDays() 공개 정적인 메소드

Subtracts the given number of business days to the DateTime.
public static SubtractBusinessDays ( this current, int days ) : System.DateTime
current this The date to be changed.
days int Number of business days to be subtracted.
리턴 System.DateTime

WeekAfter() 공개 정적인 메소드

Increases supplied DateTime for 7 days ie returns the Next Week.
public static WeekAfter ( this start ) : System.DateTime
start this
리턴 System.DateTime

WeekEarlier() 공개 정적인 메소드

Decreases supplied DateTime for 7 days ie returns the Previous Week.
public static WeekEarlier ( this start ) : System.DateTime
start this
리턴 System.DateTime