How to convert the date displayed 7/19/2010 12:00:00 AM to July/Sunday/2010???
thanx a lot......
2010-07-19 07:54:51
+1
A:
Do you already have this as a DateTime? If so, it's easy:
string text = dt.ToString("MMMM'/'dddd'/'yyyy");
This will use the thread's current culture - you can use a specific culture or the invariant culture, e.g.
string text = dt.ToString("MMMM'/'dddd'/'yyyy",
CultureInfo.InvariantCulture);
Note that the "/" has been escaped here, as otherwise it would use the culture's date separator symbol. Another option for escaping is to use a backslash, but then you need to either escape that or use a verbatim string literal (assuming C# due to your previous questions):
string text = dt.ToString(@"MMMM\/dddd\/yyyy");
Jon Skeet
2010-07-19 07:21:32