I searched SO to find the answer to this issue, and found "How to add literal strings in a DateTime format?".
I tried the accepted solution, but did not get the result that I expected. My code is below:
DateTime.Now.ToString("'Previously exported on' d 'at' t")
which returns "Previously exported on 7 at P"
I had expected it to return "Previously exported on 02/07/2014 at 05:46 PM"
I also tried:
DateTime.Now.ToString("'Previously exported on' f")
which returns "Previously exported on 0"
However, if I only use the simple format strings, I get the expected results:
DateTime.Now.ToString("d")
returns "02/07/2014"
DateTime.Now.ToString("t")
returns "05:46 PM"
DateTime.Now.ToString("f")
returns "Friday, February 07, 2014 05:46 PM"
What am I missing? Can the "short" format string NOT be used with the literals?