How to format a date?

  • Thread starter Thread starter ZippyV
  • Start date Start date
Z

ZippyV

Hello everybody ,
I need to retrieve the month and the year of a given date. I need to have 2
digits for the month and the month, but I don't know how to format it.
Can somebody give me an example?

Thanks!
 
Hi,

Dim dt As DateTime = DateTime.Parse("Dec 01, 2004")

Dim intMonth As Integer = dt.Month

Trace.WriteLine(intMonth.ToString("00"))



Ken

---------------------

Hello everybody ,
I need to retrieve the month and the year of a given date. I need to have 2
digits for the month and the month, but I don't know how to format it.
Can somebody give me an example?

Thanks!
 
Ken,

In my opinion because there are so many people on the world who visit this
newsgroup, it is better not to use the US and Anglo Canadian notation in a
date. Using the New Date(2004,12,01) is global.

However just my opinion,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top