Date format VB 2005 beta

Dim mystrAsString
mystr = TextBox2.Text
TextBox2.Text = Format(mystr,
"dd MMM yyyy")

If date typed in as 01-01-2001 in VB6 will give 01 JAN 2001.
If date typed in as 01-01-2001 in VB 2005 Beta will give - dd MMM yyyy

Im assuming Im wrong somewhere.
Any ideas please.
Thanks,
Blinky.

[560 byte] By [Blinky] at [2007-12-16]
# 1
you can use..

String.Format("D", DateTime.Parse(mystr))
DateTime.ToString: DateTime.Parse(mystr).ToString("D")

JungYi at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
Thanks for reply.
Unfortunatly DateTime.ToString errors.
Bill.
Blinky at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3

You need to convert the string to a date, ie:

TextBox2.Text = Format(CDate(mystr),"dd MMM yyyy")

Hope this helps,
Adam Braden
Visual Basic Team

AdamBraden-MS at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...