How to format a datetime to display day of week and date?
-
I'm trying to display a date in a c# ms excel report (via the office object library dll) to display as the following (including the commas): Wednesday, May 4, 2011 I've tried several attempts but no luck so far. What's the format I should be using to display a c# datetime correctly? Thanks.
-
I'm trying to display a date in a c# ms excel report (via the office object library dll) to display as the following (including the commas): Wednesday, May 4, 2011 I've tried several attempts but no luck so far. What's the format I should be using to display a c# datetime correctly? Thanks.
-
I'm trying to display a date in a c# ms excel report (via the office object library dll) to display as the following (including the commas): Wednesday, May 4, 2011 I've tried several attempts but no luck so far. What's the format I should be using to display a c# datetime correctly? Thanks.
You can format DateTime strings in .NET any way you want. This little article[^] of mine contains the necessary links to MSDN, and more. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
I'm trying to display a date in a c# ms excel report (via the office object library dll) to display as the following (including the commas): Wednesday, May 4, 2011 I've tried several attempts but no luck so far. What's the format I should be using to display a c# datetime correctly? Thanks.
Or maybe use the long date time option.
-
I'm trying to display a date in a c# ms excel report (via the office object library dll) to display as the following (including the commas): Wednesday, May 4, 2011 I've tried several attempts but no luck so far. What's the format I should be using to display a c# datetime correctly? Thanks.
-
I'm trying to display a date in a c# ms excel report (via the office object library dll) to display as the following (including the commas): Wednesday, May 4, 2011 I've tried several attempts but no luck so far. What's the format I should be using to display a c# datetime correctly? Thanks.
Thanks for the help. My solution kept unfortunately having issues using the above formats within my excel report however when I placed a comma in front of the date, it worked fine. String reportDate = "'" + DateTime.Now.ToString("dddd, MMMM d, yyyy"); Thanks.