C# 클래스 Utilities.Extensions.DateExtensions

파일 보기 프로젝트 열기: feanz/Utilities

공개 메소드들

메소드 설명
Diff ( this dateOne, System.DateTime dateTwo ) : System.TimeSpan

Diffs the specified date.

DiffDays ( this dateOne, System.DateTime dateTwo ) : double

Returns a double indicating the number of days between two dates (past is negative)

DiffDays ( this dateOne, string dateTwo ) : double

Returns a double indicating the number of days between two dates (past is negative)

DiffHours ( this dateOne, System.DateTime dateTwo ) : double

Returns a double indicating the number of days between two dates (past is negative)

DiffHours ( this dateOne, string dateTwo ) : double

Returns a double indicating the number of days between two dates (past is negative)

DiffMinutes ( this dateOne, System.DateTime dateTwo ) : double

Returns a double indicating the number of days between two dates (past is negative)

DiffMinutes ( this dateOne, string dateTwo ) : double

Returns a double indicating the number of days between two dates (past is negative)

GetDateDayWithSuffix ( this date ) : string

Given a datetime object, returns the formatted day, "15th"

GetFormattedMonthAndDay ( this date ) : string

Given a datetime object, returns the formatted month and day, i.e. "April 15th"

IsLastDayOfMonth ( this date ) : bool

Determines whether [is last day of month] [the specified date].

IsLeapYear ( this date ) : bool

Determines whether [is leap year] [the specified date].

IsWeekDay ( this dt ) : bool

Checks to see if the date is a week day (Mon - Fri)

IsWeekend ( this source ) : bool

Determines whether the specified date is a weekend.

LastDayOfMonth ( this date ) : int

Gets the Last the day of month.

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

Returns a new instance of DateTime with a different day of the month.

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

Returns a new instance of DateTime with a different month.

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

Returns a new instance of DateTime with a different year.

ToMigrationString ( this dt ) : string

Returns a datetime formatted as a string in yyyyMMddhhmm

메소드 상세

Diff() 공개 정적인 메소드

Diffs the specified date.
public static Diff ( this dateOne, System.DateTime dateTwo ) : System.TimeSpan
dateOne this The date one.
dateTwo System.DateTime The date two.
리턴 System.TimeSpan

DiffDays() 공개 정적인 메소드

Returns a double indicating the number of days between two dates (past is negative)
public static DiffDays ( this dateOne, System.DateTime dateTwo ) : double
dateOne this The date one.
dateTwo System.DateTime The date two.
리턴 double

DiffDays() 공개 정적인 메소드

Returns a double indicating the number of days between two dates (past is negative)
public static DiffDays ( this dateOne, string dateTwo ) : double
dateOne this The date one.
dateTwo string The date two.
리턴 double

DiffHours() 공개 정적인 메소드

Returns a double indicating the number of days between two dates (past is negative)
public static DiffHours ( this dateOne, System.DateTime dateTwo ) : double
dateOne this The date one.
dateTwo System.DateTime The date two.
리턴 double

DiffHours() 공개 정적인 메소드

Returns a double indicating the number of days between two dates (past is negative)
public static DiffHours ( this dateOne, string dateTwo ) : double
dateOne this The date one.
dateTwo string The date two.
리턴 double

DiffMinutes() 공개 정적인 메소드

Returns a double indicating the number of days between two dates (past is negative)
public static DiffMinutes ( this dateOne, System.DateTime dateTwo ) : double
dateOne this The date one.
dateTwo System.DateTime The date two.
리턴 double

DiffMinutes() 공개 정적인 메소드

Returns a double indicating the number of days between two dates (past is negative)
public static DiffMinutes ( this dateOne, string dateTwo ) : double
dateOne this The date one.
dateTwo string The date two.
리턴 double

GetDateDayWithSuffix() 공개 정적인 메소드

Given a datetime object, returns the formatted day, "15th"
public static GetDateDayWithSuffix ( this date ) : string
date this The date to extract the string from
리턴 string

GetFormattedMonthAndDay() 공개 정적인 메소드

Given a datetime object, returns the formatted month and day, i.e. "April 15th"
public static GetFormattedMonthAndDay ( this date ) : string
date this The date to extract the string from
리턴 string

IsLastDayOfMonth() 공개 정적인 메소드

Determines whether [is last day of month] [the specified date].
public static IsLastDayOfMonth ( this date ) : bool
date this The date.
리턴 bool

IsLeapYear() 공개 정적인 메소드

Determines whether [is leap year] [the specified date].
public static IsLeapYear ( this date ) : bool
date this The date.
리턴 bool

IsWeekDay() 공개 정적인 메소드

Checks to see if the date is a week day (Mon - Fri)
public static IsWeekDay ( this dt ) : bool
dt this The dt.
리턴 bool

IsWeekend() 공개 정적인 메소드

Determines whether the specified date is a weekend.
public static IsWeekend ( this source ) : bool
source this Source date
리턴 bool

LastDayOfMonth() 공개 정적인 메소드

Gets the Last the day of month.
public static LastDayOfMonth ( this date ) : int
date this The date.
리턴 int

SetDay() 공개 정적인 메소드

Returns a new instance of DateTime with a different day of the month.
public static SetDay ( this source, int day ) : System.DateTime
source this Base DateTime object to modify
day int Day of the month (1-31)
리턴 System.DateTime

SetMonth() 공개 정적인 메소드

Returns a new instance of DateTime with a different month.
public static SetMonth ( this source, int month ) : System.DateTime
source this Base DateTime object to modify
month int The month as an integer (1-12)
리턴 System.DateTime

SetYear() 공개 정적인 메소드

Returns a new instance of DateTime with a different year.
public static SetYear ( this source, int year ) : System.DateTime
source this Base DateTime object to modify
year int The year
리턴 System.DateTime

ToMigrationString() 공개 정적인 메소드

Returns a datetime formatted as a string in yyyyMMddhhmm
public static ToMigrationString ( this dt ) : string
dt this The datetime to convert
리턴 string