Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


formatting date

Posted on 2004-10-13
Medium Priority
Last Modified: 2010-04-15
Hi Experts,

By default calendar returns : Monday, January 03, 2005
I would see it in form         : 01/03/2005

What ready-to-use method is in .NET to format it ?

Or may be yours :)

Thank you.
Question by:fpoyavo
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 15

Expert Comment

ID: 12303334
Assuming it returns a DateTime object, use this:


Replace dateTime with your DateTime object.

Accepted Solution

yellowjetski earned 2000 total points
ID: 12304951
Here's how to use it

DateTime.Now.ToString("yyyyMMdd"") for 20041013


DateTime.Now.ToString("yyyy/MM/dd") for 2004/10/13


DateTime.Now.ToString("HHmmss") for 221232


DateTime.Now.ToString("HH:mm:ss") for 22:12:32

Here's a better link, I think. The Format Pattern in this link really helps



Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 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