datetime class : ToString() method

Description

Gets a string representation of the invoker instance.

Syntax

datetimeInstance.ToString()

Arguments

None

Return value

ClassDescription
stringA string representation of the invoker instance.

Sample code

1:

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

2:

string dtString = dt.ToString(); // 2013/12/14 10:10:09

Notes

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

Links for reference

Copyright © Cooker All rights reserved.