views:

65

answers:

2
+2  Q: 

Date conversion

How to convert the date displayed 7/19/2010 12:00:00 AM to July/Sunday/2010???

A: 

Something like this:

 DateTime.Now.ToString(@"MMMM\/dddd\/yyyy");
ck
thanx a lot......
+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
thanx a lot.... third exactly suits my requirement.