Formatting date

  • Thread starter Thread starter fniles
  • Start date Start date
F

fniles

In VB6, when you do Format(Date$, "medium date"), you get something like
"25-Aug-06".
How can I do that in VB.NET ?
Thanks.
 
fniles said:
In VB6, when you do Format(Date$, "medium date"), you get something like
"25-Aug-06".
How can I do that in VB.NET ?

Check out the documentation on 'DateTime.ToString'.
 
Thanks.
I looked at it, but I can not find any formatting there that gives me the
"medium date" (ie 03-Jan-07).
Is there any way to do that in VB.NET ?
 
fniles said:
I looked at it, but I can not find any formatting there that gives me the
"medium date" (ie 03-Jan-07).

\\\
MsgBox(dt.ToString("dd\-MMM\-yy"))
///
 
Thanks.
I looked at it, but I can not find any formatting there that gives me the
"medium date" (ie 03-Jan-07).
Is there any way to do that in VB.NET ?

Hey,

Here's a small program to illustrate

Dim myDate as DateTime = DateTime.Now
Console.WriteLine(myDate.ToString("dd-MMM-yyyy"))
 
Back
Top