C# Class Sage.XsltExtensions.Date

ファイルを表示 Open project: igorfrance/sage

Public Methods

Method Description
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.

Private Methods

Method Description
parse ( string dateTime ) : DateTime?

Method Details

date() public method

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.
return string

date() public method

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.
return string

day() public method

Parses the specified dateTime as DateTime and returns the day.
public day ( string dateTime ) : int
dateTime string The date-time string to parse.
return int

difference() public method

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
return int

difference() public method

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'.
return int

hour() public method

Parses the specified dateTime as DateTime and returns the hour.
public hour ( string dateTime ) : int
dateTime string The date-time string to parse.
return int

minute() public method

Parses the specified dateTime as DateTime and returns the minute.
public minute ( string dateTime ) : int
dateTime string The date-time string to parse.
return int

month() public method

Parses the specified dateTime as DateTime and returns the month.
public month ( string dateTime ) : int
dateTime string The date-time string to parse.
return int

nearestWeekday() public method

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.
return string

nearestWeekday() public method

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.
return string

quarter() public method

Parses the specified dateTime as DateTime and returns the quarter.
public quarter ( string dateTime ) : int
dateTime string The date-time string to parse.
return int

second() public method

Parses the specified dateTime as DateTime and returns the second.
public second ( string dateTime ) : int
dateTime string The date-time string to parse.
return int

time() public method

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.
return string

time() public method

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.
return string

year() public method

Parses the specified dateTime as DateTime and returns the year.
public year ( string dateTime ) : int
dateTime string The date-time string to parse.
return int