C# 클래스 DevUtils.DateTimeExtensions.DateExtensions

Convert values to date
파일 보기 프로젝트 열기: jornfilho/.net-Dev-Utils

공개 메소드들

메소드 설명
FromUnixTimestamp ( this unixTimestap ) : System.DateTime

Convert unix timestamp to date

GetWeekNumber ( this date ) : int

Get the week number of a date

Use BaseDateTimeExtensions.GetDefaultCalendarRule() as default calendar rule

Use BaseDateTimeExtensions.GetDefaultFirstWeekDay() as first week day

GetWeekNumber ( this date, CalendarWeekRule weekRule ) : int

Get the week number of a date

Use BaseDateTimeExtensions.GetDefaultFirstWeekDay() as first week day

GetWeekNumber ( this date, CalendarWeekRule weekRule, DayOfWeek firstWeekDay ) : int

Get the week number of a date

GetWeekNumber ( this date, DayOfWeek firstWeekDay ) : int

Get the week number of a date

Use BaseDateTimeExtensions.GetDefaultCalendarRule() as default calendar rule

IsValidDate ( this strValue ) : bool

Test if string value is a valid date value

IsValidDate ( this strValue, CultureInfo culture, DateTimeStyles dateTimeStyle ) : bool

Test if string value is a valid date value

SetAsUtc ( this date ) : System.DateTime

Convert date local to utc

Only change date local, don`t convert date and time

ToTimezoneDate ( this date, TimeZoneInfo destinationTimeZoneInfo ) : System.DateTime

Convert date to an especific timezone

ToTimezoneDate ( this date, TimeZoneInfo currentTimeZoneInfo, TimeZoneInfo destinationTimeZoneInfo ) : System.DateTime

Convert date to an especific timezone

ToTimezoneDate ( this date, TimeZoneInfo currentTimezoneInfo, string destinationTimeZoneName ) : System.DateTime

Convert date to an especific timezone

ToTimezoneDate ( this date, string destinationTimeZoneName ) : System.DateTime

Convert date to an especific timezone

ToTimezoneDate ( this date, string currentTimeZoneName, TimeZoneInfo destinationTimeZoneInfo ) : System.DateTime

Convert date to an especific timezone

ToTimezoneDate ( this date, string currentTimeZoneName, string destinationTimeZoneName ) : System.DateTime

Convert date to an especific timezone

ToUnixTimestamp ( this date ) : long

Convert date to unix timestamp

ToUnixTimestamp ( this date, TimeZoneInfo timezoneInfo ) : long

Convert date to unix timestamp

ToUnixTimestamp ( this date, string timezoneName ) : long

Convert date to unix timestamp

ToUtc ( this date ) : System.DateTime

Convert date to UtcDate

ToUtc ( this date, TimeZoneInfo timezoneInfo ) : System.DateTime

Convert date to UtcDate

ToUtc ( this date, string timezoneName ) : System.DateTime

Convert date to UtcDate

TryParseDate ( this strValue ) : System.DateTime

Convert string date to datetime

Return BaseDateTimeExtensions.GetCurrentDateTime() on error

TryParseDate ( this strValue, CultureInfo culture, DateTimeStyles dateTimeStyle ) : System.DateTime

Convert string date to datetime

Return BaseDateTimeExtensions.GetCurrentDateTime() on error

TryParseDate ( this strValue, System.DateTime defaultValue ) : System.DateTime

Convert string date to datetime

TryParseDate ( this strValue, System.DateTime defaultValue, CultureInfo culture, DateTimeStyles dateTimeStyle ) : System.DateTime

Convert string date to datetime

메소드 상세

FromUnixTimestamp() 공개 정적인 메소드

Convert unix timestamp to date
public static FromUnixTimestamp ( this unixTimestap ) : System.DateTime
unixTimestap this unix to convert
리턴 System.DateTime

GetWeekNumber() 공개 정적인 메소드

Get the week number of a date

Use BaseDateTimeExtensions.GetDefaultCalendarRule() as default calendar rule

Use BaseDateTimeExtensions.GetDefaultFirstWeekDay() as first week day

public static GetWeekNumber ( this date ) : int
date this Date to get week number
리턴 int

GetWeekNumber() 공개 정적인 메소드

Get the week number of a date

Use BaseDateTimeExtensions.GetDefaultFirstWeekDay() as first week day

public static GetWeekNumber ( this date, CalendarWeekRule weekRule ) : int
date this Date to get week number
weekRule CalendarWeekRule Rule to calculate week number
리턴 int

GetWeekNumber() 공개 정적인 메소드

Get the week number of a date
public static GetWeekNumber ( this date, CalendarWeekRule weekRule, DayOfWeek firstWeekDay ) : int
date this Date to get week number
weekRule CalendarWeekRule Rule to calculate week number
firstWeekDay DayOfWeek First day of week
리턴 int

GetWeekNumber() 공개 정적인 메소드

Get the week number of a date

Use BaseDateTimeExtensions.GetDefaultCalendarRule() as default calendar rule

public static GetWeekNumber ( this date, DayOfWeek firstWeekDay ) : int
date this Date to get week number
firstWeekDay DayOfWeek First day of week
리턴 int

IsValidDate() 공개 정적인 메소드

Test if string value is a valid date value
public static IsValidDate ( this strValue ) : bool
strValue this string value
리턴 bool

IsValidDate() 공개 정적인 메소드

Test if string value is a valid date value
public static IsValidDate ( this strValue, CultureInfo culture, DateTimeStyles dateTimeStyle ) : bool
strValue this string value
culture System.Globalization.CultureInfo culture origin
dateTimeStyle DateTimeStyles date style to convert
리턴 bool

SetAsUtc() 공개 정적인 메소드

Convert date local to utc

Only change date local, don`t convert date and time

public static SetAsUtc ( this date ) : System.DateTime
date this Date to set local
리턴 System.DateTime

ToTimezoneDate() 공개 정적인 메소드

Convert date to an especific timezone
public static ToTimezoneDate ( this date, TimeZoneInfo destinationTimeZoneInfo ) : System.DateTime
date this date to convert
destinationTimeZoneInfo System.TimeZoneInfo destination date timezone info
리턴 System.DateTime

ToTimezoneDate() 공개 정적인 메소드

Convert date to an especific timezone
public static ToTimezoneDate ( this date, TimeZoneInfo currentTimeZoneInfo, TimeZoneInfo destinationTimeZoneInfo ) : System.DateTime
date this date to convert
currentTimeZoneInfo System.TimeZoneInfo current date timezone info
destinationTimeZoneInfo System.TimeZoneInfo destination date timezone info
리턴 System.DateTime

ToTimezoneDate() 공개 정적인 메소드

Convert date to an especific timezone
public static ToTimezoneDate ( this date, TimeZoneInfo currentTimezoneInfo, string destinationTimeZoneName ) : System.DateTime
date this date to convert
currentTimezoneInfo System.TimeZoneInfo current date timezone info
destinationTimeZoneName string destination date timezone name
리턴 System.DateTime

ToTimezoneDate() 공개 정적인 메소드

Convert date to an especific timezone
public static ToTimezoneDate ( this date, string destinationTimeZoneName ) : System.DateTime
date this date to convert
destinationTimeZoneName string destination date timezone name
리턴 System.DateTime

ToTimezoneDate() 공개 정적인 메소드

Convert date to an especific timezone
public static ToTimezoneDate ( this date, string currentTimeZoneName, TimeZoneInfo destinationTimeZoneInfo ) : System.DateTime
date this date to convert
currentTimeZoneName string current date timezone name
destinationTimeZoneInfo System.TimeZoneInfo destination date timezone info
리턴 System.DateTime

ToTimezoneDate() 공개 정적인 메소드

Convert date to an especific timezone
public static ToTimezoneDate ( this date, string currentTimeZoneName, string destinationTimeZoneName ) : System.DateTime
date this date to convert
currentTimeZoneName string current date timezone name
destinationTimeZoneName string destination date timezone name
리턴 System.DateTime

ToUnixTimestamp() 공개 정적인 메소드

Convert date to unix timestamp
public static ToUnixTimestamp ( this date ) : long
date this date to convert
리턴 long

ToUnixTimestamp() 공개 정적인 메소드

Convert date to unix timestamp
public static ToUnixTimestamp ( this date, TimeZoneInfo timezoneInfo ) : long
date this date to convert
timezoneInfo System.TimeZoneInfo current date timezone info
리턴 long

ToUnixTimestamp() 공개 정적인 메소드

Convert date to unix timestamp
public static ToUnixTimestamp ( this date, string timezoneName ) : long
date this date to convert
timezoneName string current date timezone name
리턴 long

ToUtc() 공개 정적인 메소드

Convert date to UtcDate
public static ToUtc ( this date ) : System.DateTime
date this date to convert
리턴 System.DateTime

ToUtc() 공개 정적인 메소드

Convert date to UtcDate
public static ToUtc ( this date, TimeZoneInfo timezoneInfo ) : System.DateTime
date this date to convert
timezoneInfo System.TimeZoneInfo current date timezone info
리턴 System.DateTime

ToUtc() 공개 정적인 메소드

Convert date to UtcDate
public static ToUtc ( this date, string timezoneName ) : System.DateTime
date this date to convert
timezoneName string current date timezone name
리턴 System.DateTime

TryParseDate() 공개 정적인 메소드

Convert string date to datetime

Return BaseDateTimeExtensions.GetCurrentDateTime() on error

public static TryParseDate ( this strValue ) : System.DateTime
strValue this string to convert
리턴 System.DateTime

TryParseDate() 공개 정적인 메소드

Convert string date to datetime

Return BaseDateTimeExtensions.GetCurrentDateTime() on error

public static TryParseDate ( this strValue, CultureInfo culture, DateTimeStyles dateTimeStyle ) : System.DateTime
strValue this string to convert
culture System.Globalization.CultureInfo date culture
dateTimeStyle DateTimeStyles datetime style
리턴 System.DateTime

TryParseDate() 공개 정적인 메소드

Convert string date to datetime

public static TryParseDate ( this strValue, System.DateTime defaultValue ) : System.DateTime
strValue this string to convert
defaultValue System.DateTime default value when invalid date
리턴 System.DateTime

TryParseDate() 공개 정적인 메소드

Convert string date to datetime
public static TryParseDate ( this strValue, System.DateTime defaultValue, CultureInfo culture, DateTimeStyles dateTimeStyle ) : System.DateTime
strValue this string to convert
defaultValue System.DateTime default value when invalid date
culture System.Globalization.CultureInfo date culture
dateTimeStyle DateTimeStyles datetime style
리턴 System.DateTime