"pvong" <phillip*at*yahoo*dot*comwrote in message
news:e6**************@TK2MSFTNGP05.phx.gbl...
Doing this in VB.NET
I have a Textbox1 with a date like 8/6/2008. I have a Label1 that I want
to show the date as 2008-08-06. Can someone help me convert this?
Dim dtmDate As DateTime = DateTime.ParseExact(Textbox1.Text, "M/d/yyyy",
Nothing);
Label1.Text = dtmDate.ToString("yyyy-MM-dd")
N.B. "2008-08-06" is an ambiguous date format because it's not possible to
uniquely differentiate between the month and the day - depending where you
are in the world, this will be seen as 8th June. not 6th August. Use a
three-digit month instead.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net