By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,163 Members | 1,286 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,163 IT Pros & Developers. It's quick & easy.

How to format a date?

P: n/a
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!
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

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

Dim intMonth As Integer = dt.Month

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

Ken

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

"ZippyV" <do**@mail.me> wrote in message
news:ON**************@tk2msftngp13.phx.gbl...
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!

Nov 21 '05 #2

P: n/a
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
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.