C# Class Hawkeye.DateTimeExtensions

Some useful DateTime-related extension methods.
Show file Open project: odalet/Hawkeye2

Public Methods

Method Description
ToLongInvariantString ( this dateTime ) : string

Converts the date to a long invariant string representation (format = "yyyy/MM/dd hh:mm:ss").

ToLongString ( this day ) : string

Formats the specified day as a long string.

ToLongString ( this day, CultureInfo culture ) : string

Formats the specified day as a long string.

ToShortInvariantString ( this dateTime ) : string

Converts the date to a short invariant string representation (format = "yyyy/MM/dd").

ToShortString ( this day ) : string

Formats the specified day as a short string (three letters).

ToShortString ( this day, CultureInfo culture ) : string

Formats the specified day as a short string (three letters).

ToVeryLongInvariantString ( this dateTime ) : string

Converts the date to a very long invariant string representation (format = "yyyy/MM/dd hh:mm:ss.FFFFFFF").

Private Methods

Method Description
ToFormattedString ( this day, string format, CultureInfo culture ) : string

Method Details

ToLongInvariantString() public static method

Converts the date to a long invariant string representation (format = "yyyy/MM/dd hh:mm:ss").
public static ToLongInvariantString ( this dateTime ) : string
dateTime this The date time to convert.
return string

ToLongString() public static method

Formats the specified day as a long string.
public static ToLongString ( this day ) : string
day this The day.
return string

ToLongString() public static method

Formats the specified day as a long string.
public static ToLongString ( this day, CultureInfo culture ) : string
day this The day.
culture System.Globalization.CultureInfo The culture.
return string

ToShortInvariantString() public static method

Converts the date to a short invariant string representation (format = "yyyy/MM/dd").
public static ToShortInvariantString ( this dateTime ) : string
dateTime this The date time to convert.
return string

ToShortString() public static method

Formats the specified day as a short string (three letters).
public static ToShortString ( this day ) : string
day this The day.
return string

ToShortString() public static method

Formats the specified day as a short string (three letters).
public static ToShortString ( this day, CultureInfo culture ) : string
day this The day.
culture System.Globalization.CultureInfo The culture.
return string

ToVeryLongInvariantString() public static method

Converts the date to a very long invariant string representation (format = "yyyy/MM/dd hh:mm:ss.FFFFFFF").
public static ToVeryLongInvariantString ( this dateTime ) : string
dateTime this The date time to convert.
return string