C# 클래스 Aspectacular.DateTimeExtensions

Contains utility & convenience DateTime methods
파일 보기 프로젝트 열기: vgribok/Aspectacular

공개 메소드들

메소드 설명
FromSortableIntDateTime ( this sortableDateTime, DateTimeKind dtKind = DateTimeKind.Unspecified ) : System.DateTime

Returns DateTime created from an integer in the YYYYMMDD, YYYYMMDDHHmmss, or YYYYMMDDHHmmssFFF format.

FromSortableIntDateTime ( this sortableDateTime, DateTimeKind dtKind = DateTimeKind.Unspecified ) : DateTime?

Returns DateTime created from an integer in the YYYYMMDD, YYYYMMDDHHmmss, or YYYYMMDDHHmmssFFF format.

FromSortableIntTime ( this sortableDateTime, System.DateTime datePart = default(DateTime) ) : System.DateTime

Returns time value via DateTime result created from integer in the HHmmss or HHmmssFFF format. Optional "FFF" is milliseconds.

FromSortableIntTime ( this sortableDateTime, System.DateTime datePart = default(DateTime) ) : DateTime?

Returns time value via DateTime result created from integer in the HHmmss or HHmmssFFF format. Optional "FFF" is milliseconds.

GoTo ( this dt, bool>.Func stopCondFunc, DateTime>.Func stepFunc ) : System.DateTime

DateTime loop functional implementation. Continues calling stepFunc while searchFunc keeps returning true: while (!searchFunc(dt)) dt = stepFunc(dt); return dt;

GoTo ( this dt, bool>.Func stopCondFunc, DateTimeOffset>.Func stepFunc ) : DateTimeOffset

DateTimeOffset loop functional implementation. Continues calling stepFunc while searchFunc keeps returning true: while (!searchFunc(dt)) dt = stepFunc(dt); return dt;

IsUtc ( this dto ) : bool

Returns true if DateTimeOffset represents UTC time.

PreviousMoment ( this dt ) : System.DateTime

Subtracts 1 tick from the given time.

PreviousMoment ( this dt ) : DateTimeOffset

Subtracts 1 tick from the given time.

Quarter ( this dt ) : int

Returns quarter number 1..4

ToDateTime ( this dto, DateTimeKind kind ) : System.DateTime
ToSortableIntDate ( this dt ) : int

Converts date part of the date time to integer in the YYYYMMDD format.

ToSortableIntTime ( this dt, bool includeMilliseconds = false ) : int

Returns integer in the format of HHmmss or HHmmssFFF. Optional "FFF" is milliseconds.

ToSortableLongDateTime ( this dt, bool includeMilliseconds = false ) : long

Returns integer in the format of YYYYMMDDHHmmss or similar with fractional seconds.

ToSortableLongTime ( this dt, bool includeMilliseconds = false ) : long

Returns integer in the format of HHmmss or HHmmssFFF. Optional "FFF" is milliseconds.

WeekOfYear ( this dt, CalendarWeekRule whatIsFirstWeek = CalendarWeekRule.FirstFourDayWeek ) : int

Returns ISO-8601 week number in the year.

메소드 상세

FromSortableIntDateTime() 공개 정적인 메소드

Returns DateTime created from an integer in the YYYYMMDD, YYYYMMDDHHmmss, or YYYYMMDDHHmmssFFF format.
public static FromSortableIntDateTime ( this sortableDateTime, DateTimeKind dtKind = DateTimeKind.Unspecified ) : System.DateTime
sortableDateTime this
dtKind DateTimeKind
리턴 System.DateTime

FromSortableIntDateTime() 공개 정적인 메소드

Returns DateTime created from an integer in the YYYYMMDD, YYYYMMDDHHmmss, or YYYYMMDDHHmmssFFF format.
public static FromSortableIntDateTime ( this sortableDateTime, DateTimeKind dtKind = DateTimeKind.Unspecified ) : DateTime?
sortableDateTime this
dtKind DateTimeKind
리턴 DateTime?

FromSortableIntTime() 공개 정적인 메소드

Returns time value via DateTime result created from integer in the HHmmss or HHmmssFFF format. Optional "FFF" is milliseconds.
public static FromSortableIntTime ( this sortableDateTime, System.DateTime datePart = default(DateTime) ) : System.DateTime
sortableDateTime this
datePart System.DateTime Date to which time will be appended.
리턴 System.DateTime

FromSortableIntTime() 공개 정적인 메소드

Returns time value via DateTime result created from integer in the HHmmss or HHmmssFFF format. Optional "FFF" is milliseconds.
public static FromSortableIntTime ( this sortableDateTime, System.DateTime datePart = default(DateTime) ) : DateTime?
sortableDateTime this
datePart System.DateTime Date to which time will be appended.
리턴 DateTime?

GoTo() 공개 정적인 메소드

DateTime loop functional implementation. Continues calling stepFunc while searchFunc keeps returning true: while (!searchFunc(dt)) dt = stepFunc(dt); return dt;
public static GoTo ( this dt, bool>.Func stopCondFunc, DateTime>.Func stepFunc ) : System.DateTime
dt this
stopCondFunc bool>.Func
stepFunc DateTime>.Func
리턴 System.DateTime

GoTo() 공개 정적인 메소드

DateTimeOffset loop functional implementation. Continues calling stepFunc while searchFunc keeps returning true: while (!searchFunc(dt)) dt = stepFunc(dt); return dt;
public static GoTo ( this dt, bool>.Func stopCondFunc, DateTimeOffset>.Func stepFunc ) : DateTimeOffset
dt this
stopCondFunc bool>.Func
stepFunc DateTimeOffset>.Func
리턴 DateTimeOffset

IsUtc() 공개 정적인 메소드

Returns true if DateTimeOffset represents UTC time.
public static IsUtc ( this dto ) : bool
dto this
리턴 bool

PreviousMoment() 공개 정적인 메소드

Subtracts 1 tick from the given time.
public static PreviousMoment ( this dt ) : System.DateTime
dt this
리턴 System.DateTime

PreviousMoment() 공개 정적인 메소드

Subtracts 1 tick from the given time.
public static PreviousMoment ( this dt ) : DateTimeOffset
dt this
리턴 DateTimeOffset

Quarter() 공개 정적인 메소드

Returns quarter number 1..4
public static Quarter ( this dt ) : int
dt this
리턴 int

ToDateTime() 공개 정적인 메소드

public static ToDateTime ( this dto, DateTimeKind kind ) : System.DateTime
dto this
kind DateTimeKind
리턴 System.DateTime

ToSortableIntDate() 공개 정적인 메소드

Converts date part of the date time to integer in the YYYYMMDD format.
public static ToSortableIntDate ( this dt ) : int
dt this
리턴 int

ToSortableIntTime() 공개 정적인 메소드

Returns integer in the format of HHmmss or HHmmssFFF. Optional "FFF" is milliseconds.
public static ToSortableIntTime ( this dt, bool includeMilliseconds = false ) : int
dt this
includeMilliseconds bool
리턴 int

ToSortableLongDateTime() 공개 정적인 메소드

Returns integer in the format of YYYYMMDDHHmmss or similar with fractional seconds.
public static ToSortableLongDateTime ( this dt, bool includeMilliseconds = false ) : long
dt this
includeMilliseconds bool
리턴 long

ToSortableLongTime() 공개 정적인 메소드

Returns integer in the format of HHmmss or HHmmssFFF. Optional "FFF" is milliseconds.
public static ToSortableLongTime ( this dt, bool includeMilliseconds = false ) : long
dt this
includeMilliseconds bool
리턴 long

WeekOfYear() 공개 정적인 메소드

Returns ISO-8601 week number in the year.
public static WeekOfYear ( this dt, CalendarWeekRule whatIsFirstWeek = CalendarWeekRule.FirstFourDayWeek ) : int
dt this
whatIsFirstWeek CalendarWeekRule /// Tells whether the first week can be a) any incomplete week, b) a week with 4 days or /// more, or c) full week only. ///
리턴 int