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

custom date formats

P: n/a
Hi;

I would like to format a date like this this mmddyy.

I am reading records from a table using the ado.net reader

The dates vary in their length i.e. the day can be either one or two digits
and
the same is true for the month.

I tired the formatDateTime() like :
formatDateTime(rdr2.getvalue(7), dateformat.ShortDate) which yields
mmddyyyy.

The final result that I am looking for is mmddyy.

Do I need a custom date format instead of dateformat.ShortDate ?

Thanks for any insights,
--
Gordon
Nov 7 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Gordon wrote:
Hi;

I would like to format a date like this this mmddyy.

I am reading records from a table using the ado.net reader

The dates vary in their length i.e. the day can be either one or two digits
and
the same is true for the month.

I tired the formatDateTime() like :
formatDateTime(rdr2.getvalue(7), dateformat.ShortDate) which yields
mmddyyyy.
The final result that I am looking for is mmddyy.
If you have a DateTime variable, you can use the ToString method to get
the format you want:

Dim strDate As String = DateTime.Now.ToString("MMddyy")

Note the capital M in the format string. Lower case m signifies
"minutes", upper case M signifies month.

Nov 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.