C# 클래스 Cliver.DateTimeRoutines

Miscellaneous and parsing methods for DateTime
파일 보기 프로젝트 열기: MikeJansen/DateTimeRoutines 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
DefaultDateIsNow bool

공개 메소드들

메소드 설명
GetSecondsSinceUnixEpoch ( this date_time ) : uint

Amount of seconds elapsed between 1970-01-01 00:00:00 and the date-time.

TryParseDate ( this str, DateTimeFormat default_format, System.DateTime &date ) : bool

Tries to find date within the passed string and return it as DateTime structure. It recognizes only date while ignoring time, so time in the returned DateTime is always 0:0:0. If year of the date was not found then it accepts the current year.

TryParseDate ( this str, DateTimeFormat default_format, ParsedDateTime &parsed_date ) : bool

Tries to find date within the passed string and return it as ParsedDateTime object. It recognizes only date while ignoring time, so time in the returned ParsedDateTime is always 0:0:0. If year of the date was not found then it accepts the current year.

TryParseDateOrTime ( this str, DateTimeFormat default_format, System.DateTime &date_time ) : bool

Tries to find date and/or time within the passed string and return it as DateTime structure. If only date was found, time in the returned DateTime is always 0:0:0. If only time was found, date in the returned DateTime is DefaultDate.

TryParseDateOrTime ( this str, DateTimeFormat default_format, ParsedDateTime &parsed_date_time ) : bool

Tries to find date and/or time within the passed string and return it as ParsedDateTime object. If only date was found, time in the returned ParsedDateTime is always 0:0:0. If only time was found, date in the returned ParsedDateTime is DefaultDate.

TryParseDateTime ( this str, DateTimeFormat default_format, System.DateTime &date_time ) : bool

Tries to find date and time within the passed string and return it as DateTime structure.

TryParseDateTime ( this str, DateTimeFormat default_format, ParsedDateTime &parsed_date_time ) : bool

Tries to find date and time within the passed string and return it as ParsedDateTime object.

TryParseTime ( this str, DateTimeFormat default_format, System.DateTime &time ) : bool

Tries to find time within the passed string and return it as DateTime structure. It recognizes only time while ignoring date, so date in the returned DateTime is always 1/1/1.

TryParseTime ( this str, DateTimeFormat default_format, ParsedDateTime &parsed_time ) : bool

Tries to find time within the passed string and return it as ParsedDateTime object. It recognizes only time while ignoring date, so date in the returned ParsedDateTime is always 1/1/1

TryParseTime ( this str, DateTimeFormat default_format, ParsedDateTime &parsed_time, ParsedDateTime parsed_date ) : bool

Tries to find time within the passed string (relatively to the passed parsed_date if any) and return it as ParsedDateTime object. It recognizes only time while ignoring date, so date in the returned ParsedDateTime is always 1/1/1

비공개 메소드들

메소드 설명
convert_to_date ( int year, int month, int day, System.DateTime &date ) : bool

메소드 상세

GetSecondsSinceUnixEpoch() 공개 정적인 메소드

Amount of seconds elapsed between 1970-01-01 00:00:00 and the date-time.
public static GetSecondsSinceUnixEpoch ( this date_time ) : uint
date_time this date-time
리턴 uint

TryParseDate() 공개 정적인 메소드

Tries to find date within the passed string and return it as DateTime structure. It recognizes only date while ignoring time, so time in the returned DateTime is always 0:0:0. If year of the date was not found then it accepts the current year.
public static TryParseDate ( this str, DateTimeFormat default_format, System.DateTime &date ) : bool
str this string that contains date
default_format System.DateTimeFormat format to be used preferably in ambivalent instances
date System.DateTime parsed date output
리턴 bool

TryParseDate() 공개 정적인 메소드

Tries to find date within the passed string and return it as ParsedDateTime object. It recognizes only date while ignoring time, so time in the returned ParsedDateTime is always 0:0:0. If year of the date was not found then it accepts the current year.
public static TryParseDate ( this str, DateTimeFormat default_format, ParsedDateTime &parsed_date ) : bool
str this string that contains date
default_format System.DateTimeFormat format to be used preferably in ambivalent instances
parsed_date ParsedDateTime parsed date output
리턴 bool

TryParseDateOrTime() 공개 정적인 메소드

Tries to find date and/or time within the passed string and return it as DateTime structure. If only date was found, time in the returned DateTime is always 0:0:0. If only time was found, date in the returned DateTime is DefaultDate.
public static TryParseDateOrTime ( this str, DateTimeFormat default_format, System.DateTime &date_time ) : bool
str this string that contains date and(or) time
default_format System.DateTimeFormat format to be used preferably in ambivalent instances
date_time System.DateTime parsed date-time output
리턴 bool

TryParseDateOrTime() 공개 정적인 메소드

Tries to find date and/or time within the passed string and return it as ParsedDateTime object. If only date was found, time in the returned ParsedDateTime is always 0:0:0. If only time was found, date in the returned ParsedDateTime is DefaultDate.
public static TryParseDateOrTime ( this str, DateTimeFormat default_format, ParsedDateTime &parsed_date_time ) : bool
str this string that contains date-time
default_format System.DateTimeFormat format to be used preferably in ambivalent instances
parsed_date_time ParsedDateTime parsed date-time output
리턴 bool

TryParseDateTime() 공개 정적인 메소드

Tries to find date and time within the passed string and return it as DateTime structure.
public static TryParseDateTime ( this str, DateTimeFormat default_format, System.DateTime &date_time ) : bool
str this string that contains date and/or time
default_format System.DateTimeFormat format to be used preferably in ambivalent instances
date_time System.DateTime parsed date-time output
리턴 bool

TryParseDateTime() 공개 정적인 메소드

Tries to find date and time within the passed string and return it as ParsedDateTime object.
public static TryParseDateTime ( this str, DateTimeFormat default_format, ParsedDateTime &parsed_date_time ) : bool
str this string that contains date-time
default_format System.DateTimeFormat format to be used preferably in ambivalent instances
parsed_date_time ParsedDateTime parsed date-time output
리턴 bool

TryParseTime() 공개 정적인 메소드

Tries to find time within the passed string and return it as DateTime structure. It recognizes only time while ignoring date, so date in the returned DateTime is always 1/1/1.
public static TryParseTime ( this str, DateTimeFormat default_format, System.DateTime &time ) : bool
str this string that contains time
default_format System.DateTimeFormat format to be used preferably in ambivalent instances
time System.DateTime parsed time output
리턴 bool

TryParseTime() 공개 정적인 메소드

Tries to find time within the passed string and return it as ParsedDateTime object. It recognizes only time while ignoring date, so date in the returned ParsedDateTime is always 1/1/1
public static TryParseTime ( this str, DateTimeFormat default_format, ParsedDateTime &parsed_time ) : bool
str this string that contains date-time
default_format System.DateTimeFormat format to be used preferably in ambivalent instances
parsed_time ParsedDateTime parsed date-time output
리턴 bool

TryParseTime() 공개 정적인 메소드

Tries to find time within the passed string (relatively to the passed parsed_date if any) and return it as ParsedDateTime object. It recognizes only time while ignoring date, so date in the returned ParsedDateTime is always 1/1/1
public static TryParseTime ( this str, DateTimeFormat default_format, ParsedDateTime &parsed_time, ParsedDateTime parsed_date ) : bool
str this string that contains date
default_format System.DateTimeFormat format to be used preferably in ambivalent instances
parsed_time ParsedDateTime parsed date-time output
parsed_date ParsedDateTime ParsedDateTime object if the date was found within this string, else NULL
리턴 bool

프로퍼티 상세

DefaultDateIsNow 공개적으로 정적으로 프로퍼티

If true then DefaultDate property is ignored and DefaultDate is always DateTime.Now
public static bool DefaultDateIsNow
리턴 bool