c# - Date conversion -


How to change the date displaying 07/19/2010 12:00:00 AM from July / Sunday / 2010 ???

Do you already keep it as a datetime? If yes, then it's easy:

  string text = DT.ToString ("MMMM '/' dddd '/' yyyy ');  

Use the current culture of thread - you can use a specific culture or unchanging culture, for example

  string text = DT.ToString ("MMMM '/' Dddd '/' Yyyy ', culture info. Inventive culture);  

Note that "/" is saved here, otherwise it will use the date separator symbol of culture. Another option to avoid is to use a backslash, but then you need to avoid that or use a verbatim string (assuming C # due to your previous questions):

  string text = DT.ToString (@ "MMMM / dddd \ / yyyy");  

Comments