Please see:
http://msdn.microsoft.com/en-us/library/system.datetime.aspx[
^].
Pay attention for different
ToString
methods allowing to use
CultureInfo
(see the parameter
IFormatProvider
which is implemented by
CultureInfo
) or detailed format features, standard or custom:
http://msdn.microsoft.com/en-us/library/az4se3k1.aspx[
^],
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx[
^].
You are just doing wring things manipulating your string. In particular, your repeated string concatenation is bad. This is not readable and has poor performance, because strings are
immutable
(do I have to explain why?). The type
System.Text.StringBuilder
and the method
string.Format
are free from this problem. Using (especially repeated using of
immediate constants) like "," is very bad for maintenance. You should always use explicit constant (one definition of all uses of it) or resources.
—SA