Solved

formatting date

Posted on 2004-10-13
3
218 Views
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.
0
Comment
Question by:fpoyavo
[X]
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
3 Comments
 
LVL 15

Expert Comment

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

dateTime.ToShortDateString();

Replace dateTime with your DateTime object.
0
 
LVL 5

Expert Comment

by:tomasX2
ID: 12304185
0
 
LVL 3

Accepted Solution

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

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

or

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

or

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

or

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

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationdatetimeformatinfoclasstopic.asp

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

735 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