ToString()

DateTime::ToString() const method

Returns the string representation of the date and time value represented by the current object using the formatting conventions defined by the current culture.

String System::DateTime::ToString() const

Return Value

The string representation of the value represented by the current object

DateTime::ToString(const String&) const method

Returns a string representation of the date and time value represented by the current object using the specified format and formatting conventions defined by the current culture.

String System::DateTime::ToString(const String &format) const

Arguments

ParameterTypeDescription
formatconst String&A format string

Return Value

The string representation of the value represented by the current object formatted according to format defined by format and the current culture.

DateTime::ToString(const SharedPtr<IFormatProvider>&) const method

Returns a string representation of the date and time value represented by the current object using the specified format information.

String System::DateTime::ToString(const SharedPtr<IFormatProvider> &provider) const

Arguments

ParameterTypeDescription
providerconst SharedPtr<IFormatProvider>&An object representing the format information

Return Value

The string representation of the value represented by the current object formatted according to format information provided by formatProvider.

DateTime::ToString(const SharedPtr<Globalization::CultureInfo>&) const method

String System::DateTime::ToString(const SharedPtr<Globalization::CultureInfo> &culture) const

DateTime::ToString(const SharedPtr<Globalization::DateTimeFormatInfo>&) const method

String System::DateTime::ToString(const SharedPtr<Globalization::DateTimeFormatInfo> &dtfi) const

DateTime::ToString(std::nullptr_t) const method

String System::DateTime::ToString(std::nullptr_t) const

DateTime::ToString(const String&, const SharedPtr<IFormatProvider>&) const method

Returns a string representation of the date and time value represented by the current object using the specified format information.

String System::DateTime::ToString(const String &format, const SharedPtr<IFormatProvider> &provider) const

Arguments

ParameterTypeDescription
formatconst String&A format string
providerconst SharedPtr<IFormatProvider>&An object representing the format information

Return Value

The string representation of the value represented by the current object formatted according to format information provided by provider and format string format.

DateTime::ToString(const String&, const SharedPtr<Globalization::CultureInfo>&) const method

String System::DateTime::ToString(const String &format, const SharedPtr<Globalization::CultureInfo> &culture) const

DateTime::ToString(const String&, const SharedPtr<Globalization::DateTimeFormatInfo>&) const method

String System::DateTime::ToString(const String &format, const SharedPtr<Globalization::DateTimeFormatInfo> &dtfi) const

DateTime::ToString(const String&, std::nullptr_t) const method

String System::DateTime::ToString(const String &format, std::nullptr_t) const

See Also