Home Cooker Classes Others Rice CookerGX
Classes  >  datetime  >  ToString(string)
datetime class : ToString(string) method

Description

Gets a string representation that is formatted with the specified format.

Syntax

datetimeInstance.ToString(string format)

Arguments

ClassNameDescription
stringformatformat

Return value

ClassDescription
stringA formatted string representation.

Sample code

datetime dt = new datetime("2013/12/14 10:10:9");

string formedString = dt.ToString("MMM dd, yyyy");//12 14, 2013

Notes

It's a wrapper of the System.DateTime.ToString(String).

Links for reference

Copyright © Rice All rights reserved.