Datetime.Now without special characters?

I'm using C# .NET 2.0.  Is there a method that will strip out slashes and colons from DateTime.Now so that 7/29/07 12:50:20 PM looks like:

where I'm adding the underscore?
Who is Participating?
Ted BouskillConnect With a Mentor Senior Software DeveloperCommented:
You can format the string any way you want.

DarkoLordConnect With a Mentor Commented:

However note that the time will be displayed in 12 hour fourmat, however AM/PM designator will be added only where it is defined in the regional settings
DhaestConnect With a Mentor Commented:
Did you look at the format-function ?

MyDate = String.Format({0:ddMMyyyy_t,DateTime.Now())
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.