C# Класс Sage.XsltExtensions.Date

Показать файл Открыть проект

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

Метод Описание
date ( string dateTime ) : string

Parses the specified dateTime as DateTime and returns only the date as string, formatted using the default date format

date ( string dateTime, string dateFormat ) : string

Parses the specified dateTime as DateTime and returns only the date as string, formatted using the specified dateFormat.

day ( string dateTime ) : int

Parses the specified dateTime as DateTime and returns the day.

difference ( string dateTime1, string dateTime2 ) : int

Returns the difference, in days, between dateTime1 and dateTime2.

difference ( string dateTime1, string dateTime2, string unit ) : int

Returns the difference, in the specfied unit, between dateTime1 and dateTime2.

hour ( string dateTime ) : int

Parses the specified dateTime as DateTime and returns the hour.

minute ( string dateTime ) : int

Parses the specified dateTime as DateTime and returns the minute.

month ( string dateTime ) : int

Parses the specified dateTime as DateTime and returns the month.

nearestWeekday ( string dateTime, byte weekDay ) : string

Gets the nearest date on which the specified weekDay occurs, starting from and including the date parsed from dateTime, and formatted using the default date format.

nearestWeekday ( string dateTime, byte weekDay, string dateFormat ) : string

Gets the nearest date on which the specified weekDay occurs, starting from and including the date parsed from dateTime, and formatted using the specified dateFormat.

quarter ( string dateTime ) : int

Parses the specified dateTime as DateTime and returns the quarter.

second ( string dateTime ) : int

Parses the specified dateTime as DateTime and returns the second.

time ( string dateTime ) : string

Parses the specified dateTime as DateTime and returns only the time as string, formatted using the default time format

time ( string dateTime, string timeFormat ) : string

Parses the specified dateTime as DateTime and returns only the date as string, formatted using the specified timeFormat.

year ( string dateTime ) : int

Parses the specified dateTime as DateTime and returns the year.

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

Метод Описание
parse ( string dateTime ) : DateTime?

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

date() публичный Метод

Parses the specified dateTime as DateTime and returns only the date as string, formatted using the default date format
public date ( string dateTime ) : string
dateTime string The date-time string to parse.
Результат string

date() публичный Метод

Parses the specified dateTime as DateTime and returns only the date as string, formatted using the specified dateFormat.
public date ( string dateTime, string dateFormat ) : string
dateTime string The date-time string to parse.
dateFormat string The string that specifies how to format the resulting date string.
Результат string

day() публичный Метод

Parses the specified dateTime as DateTime and returns the day.
public day ( string dateTime ) : int
dateTime string The date-time string to parse.
Результат int

difference() публичный Метод

Returns the difference, in days, between dateTime1 and dateTime2.
public difference ( string dateTime1, string dateTime2 ) : int
dateTime1 string The first date
dateTime2 string The second date
Результат int

difference() публичный Метод

Returns the difference, in the specfied unit, between dateTime1 and dateTime2.
public difference ( string dateTime1, string dateTime2, string unit ) : int
dateTime1 string The first date
dateTime2 string The second date
unit string The unit in which to return the difference. Valid values are 'days', 'weeks', 'months' /// and 'years'.
Результат int

hour() публичный Метод

Parses the specified dateTime as DateTime and returns the hour.
public hour ( string dateTime ) : int
dateTime string The date-time string to parse.
Результат int

minute() публичный Метод

Parses the specified dateTime as DateTime and returns the minute.
public minute ( string dateTime ) : int
dateTime string The date-time string to parse.
Результат int

month() публичный Метод

Parses the specified dateTime as DateTime and returns the month.
public month ( string dateTime ) : int
dateTime string The date-time string to parse.
Результат int

nearestWeekday() публичный Метод

Gets the nearest date on which the specified weekDay occurs, starting from and including the date parsed from dateTime, and formatted using the default date format.
public nearestWeekday ( string dateTime, byte weekDay ) : string
dateTime string The date-time string to parse.
weekDay byte The week day.
Результат string

nearestWeekday() публичный Метод

Gets the nearest date on which the specified weekDay occurs, starting from and including the date parsed from dateTime, and formatted using the specified dateFormat.
public nearestWeekday ( string dateTime, byte weekDay, string dateFormat ) : string
dateTime string The date-time string to parse.
weekDay byte The week day.
dateFormat string The string that specifies how to format the resulting date string.
Результат string

quarter() публичный Метод

Parses the specified dateTime as DateTime and returns the quarter.
public quarter ( string dateTime ) : int
dateTime string The date-time string to parse.
Результат int

second() публичный Метод

Parses the specified dateTime as DateTime and returns the second.
public second ( string dateTime ) : int
dateTime string The date-time string to parse.
Результат int

time() публичный Метод

Parses the specified dateTime as DateTime and returns only the time as string, formatted using the default time format
public time ( string dateTime ) : string
dateTime string The date-time string to parse.
Результат string

time() публичный Метод

Parses the specified dateTime as DateTime and returns only the date as string, formatted using the specified timeFormat.
public time ( string dateTime, string timeFormat ) : string
dateTime string The date-time string to parse.
timeFormat string The string that specifies how to format the resulting time string.
Результат string

year() публичный Метод

Parses the specified dateTime as DateTime and returns the year.
public year ( string dateTime ) : int
dateTime string The date-time string to parse.
Результат int