[Last Call] Learn how to a build a cloud-first strategyRegister Now


How can I add a comma or @ to a DataFormatString

Posted on 2009-02-13
Medium Priority
Last Modified: 2012-08-14
I have the following dataformatstring in a gridview to format a date.  It works quite well, but I'd like to put a comma or @ between the date and time just to be fancy and make the department who's getting this app a little more enthused when they see it.

The string is:

0:M/dd/yyyy h:mm tt
Question by:mrcoulson
  • 2
LVL 16

Expert Comment

ID: 23633868
dt.ToString("0:M/dd/yyyy @ h:mm tt")
LVL 16

Accepted Solution

burakiewicz earned 2000 total points
ID: 23633892
or for the comma
DateTime dt = DateTime.Now;
dt.ToString("M/dd/yyyy , h:mm tt");
previos answer should be
dt.ToString("M/dd/yyyy @ h:mm tt")

Author Comment

ID: 23633903
Wow.  Had no idea it would be so simple.  Lord.  Thanks!

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question