I have a text box that is set to todays date. The problem is its formatted on the form for visual ref as 07/12/12 but it needs to be on the report(word doc/data thru mail merge) as July 12, 2012. the user can edit the date, it just populates with todays date as that is used the most.
string today = DateTime.Now.ToString("MMddyy");
LetterDate.Text = today;
var Date = String.Format(DateTime.ParseExact(LetterDate.Text,"MMddyy", CultureInfo.CurrentCulture).ToString(), "MMMM dd, yyyy");
Date gives the output as 7/12/2012 12:00:00 AM — im so lost at to why/how its even getting that format.
I know this should be easy, but its end of day and im just not seeing it.
Try
take a look on this site for more reference:
Custom Date and Time Format Strings MSDN
String Format for DateTime C# Corner
Best Regards