C# Класс Argentini.Halide.H3Temporal

The H3Temporal class contains methods and properties for manipulating, evaluating, or displaying dates and times.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CalculateAge ( System.DateTime birthday ) : Int32

Calculate an age with a given birthdate. Assumes current timezone.

CalculateAge ( System.DateTime birthday, int utcOffset ) : Int32

Calculate an age with a given birthdate.

ConvertDateToTimeZone ( System.DateTime dateTime, String timeZoneText ) : System.DateTime

Convert a DateTime value to a given time zone, automatically handling DST if using .NET CLR 3.5 or later.

DateDiff ( DateDiffComparisonType howtocompare, System startDate, System endDate ) : Double

Compares 2 dates and determine the time interval between them.

DateDiff ( DateDiffComparisonType howtocompare, System startDate, int startDateOffset, System endDate, int endDateOffset ) : Double

Compares 2 dates and determine the time interval between them taking time zones into account.

DateFormat ( System date, DateFormats format ) : String

Format a date/time variable for output.

DateFormat ( string date, DateFormats format ) : String

Format a date/time variable for output.

DateRange ( DateRangeOptions dateRangeOptions, System.DateTime relativeDate ) : DateRangeStruct

Returns a string array with start and end dates for a given range.

DateRange ( DateRangeOptions dateRangeOptions, string relativeDate ) : DateRangeStruct

Returns a string array with start and end dates for a given range.

GetMonthName ( Int32 monthNumber, System.Boolean returnAbbreviation ) : String

Get the month name by its number.

GetMonthName ( String monthNumber, System.Boolean returnAbbreviation ) : String

Get the month name by its number.

GetWeekRange ( System.DateTime date ) : System.Int32[]

Get the start and end day of a week range for a given date withina month.

TimeFormat ( System date, TimeFormats format ) : String

Format a time of day for output.

TimeFormat ( string date, TimeFormats format ) : String

Format a time of day for output.

Today ( ) : String

Return the current date as a string using slashes as delimitters (e.g. 12/31/2009).

Today ( H3Temporal format ) : String

Return the current date as a string.

Приватные методы

Метод Описание
FormatAbstract ( double value, string increment, double lowend, double halfway, double almost, bool future ) : String

Used to render abstract dates.

H3Temporal ( ) : System

Описание методов

CalculateAge() публичный статический Метод

Calculate an age with a given birthdate. Assumes current timezone.
public static CalculateAge ( System.DateTime birthday ) : Int32
birthday System.DateTime A value representing a birthday./>
Результат System.Int32

CalculateAge() публичный статический Метод

Calculate an age with a given birthdate.
public static CalculateAge ( System.DateTime birthday, int utcOffset ) : Int32
birthday System.DateTime A value representing a birthday./>
utcOffset int An value indicating the offset to apply to UTC.
Результат System.Int32

ConvertDateToTimeZone() публичный статический Метод

Convert a DateTime value to a given time zone, automatically handling DST if using .NET CLR 3.5 or later.
public static ConvertDateToTimeZone ( System.DateTime dateTime, String timeZoneText ) : System.DateTime
dateTime System.DateTime DateTime value to convert.
timeZoneText String Text value of the desired time zone. Examples include "Eastern Standard Time", "Central Standard Time", "Mountain Standard Time", "Pacific Standard Time".
Результат System.DateTime

DateDiff() публичный статический Метод

Compares 2 dates and determine the time interval between them.
public static DateDiff ( DateDiffComparisonType howtocompare, System startDate, System endDate ) : Double
howtocompare DateDiffComparisonType String specifying comparison type.
startDate System First date for comparison. If earlier than endDate, a positive result is returned.
endDate System Last date for comparison. If later than startDate, a positive result is returned.
Результат Double

DateDiff() публичный статический Метод

Compares 2 dates and determine the time interval between them taking time zones into account.
public static DateDiff ( DateDiffComparisonType howtocompare, System startDate, int startDateOffset, System endDate, int endDateOffset ) : Double
howtocompare DateDiffComparisonType String specifying compare type
startDate System First date for comparison. If earlier than endDate, a positive result is returned.
startDateOffset int UTC offset value for startDate datetime.
endDate System Last date for comparison. If later than startDate, a positive result is returned.
endDateOffset int UTC offset value for endDate datetime.
Результат Double

DateFormat() публичный статический Метод

Format a date/time variable for output.
public static DateFormat ( System date, DateFormats format ) : String
date System DateTime variable to format.
format DateFormats Date format.
Результат String

DateFormat() публичный статический Метод

Format a date/time variable for output.
public static DateFormat ( string date, DateFormats format ) : String
date string DateTime variable to format.
format DateFormats Date format.
Результат String

DateRange() публичный статический Метод

Returns a string array with start and end dates for a given range.
public static DateRange ( DateRangeOptions dateRangeOptions, System.DateTime relativeDate ) : DateRangeStruct
dateRangeOptions DateRangeOptions Enumeration value specifying which abstracted date range to evaluate. Note, weeks begin on Sunday and end on Saturday.
relativeDate System.DateTime Date to use as the basis for calculating the start and end date of the range.
Результат DateRangeStruct

DateRange() публичный статический Метод

Returns a string array with start and end dates for a given range.
public static DateRange ( DateRangeOptions dateRangeOptions, string relativeDate ) : DateRangeStruct
dateRangeOptions DateRangeOptions Enumeration value specifying which abstracted date range to evaluate. Note, weeks begin on Sunday and end on Saturday.
relativeDate string Date to use as the basis for calculating the start and end date of the range.
Результат DateRangeStruct

GetMonthName() публичный статический Метод

Get the month name by its number.
public static GetMonthName ( Int32 monthNumber, System.Boolean returnAbbreviation ) : String
monthNumber System.Int32 Month number for which a name is requested (1 to 12).
returnAbbreviation System.Boolean Set to "true" to return month names abbreviation (e.g. Dec).
Результат String

GetMonthName() публичный статический Метод

Get the month name by its number.
public static GetMonthName ( String monthNumber, System.Boolean returnAbbreviation ) : String
monthNumber String Month number for which a name is requested (1 to 12).
returnAbbreviation System.Boolean Set to "true" to return month names abbreviation (e.g. Dec).
Результат String

GetWeekRange() публичный статический Метод

Get the start and end day of a week range for a given date withina month.
public static GetWeekRange ( System.DateTime date ) : System.Int32[]
date System.DateTime Date for which you'd like the week day range.
Результат System.Int32[]

TimeFormat() публичный статический Метод

Format a time of day for output.
public static TimeFormat ( System date, TimeFormats format ) : String
date System Time variable to format.
format TimeFormats Time format.
Результат String

TimeFormat() публичный статический Метод

Format a time of day for output.
public static TimeFormat ( string date, TimeFormats format ) : String
date string Time variable to format.
format TimeFormats Time format.
Результат String

Today() публичный статический Метод

Return the current date as a string using slashes as delimitters (e.g. 12/31/2009).
public static Today ( ) : String
Результат String

Today() публичный статический Метод

Return the current date as a string.
public static Today ( H3Temporal format ) : String
format H3Temporal H3Temporal.DateFormats value for formatting the date.
Результат String