Hi Geri,
Here's something you could try:
string txtDate = "21/12/2004";
System.Globalization.CultureInfo culture =
new System.Globalization.CultureInfo("FR-fr");
string newDate = DateTime.Parse(txtDate, culture).ToString("yyyyMMdd");
Console.WriteLine(newDate);
The code above demonstrates my suggestion of parsing your text value into a DateTime and reformatting it how you want. I'm making the assumption that you need to specify CultureInfo based on the way you formatted the date. It doesn't parse (raises an exception) on my machine, which is set to en-US.
Joe
--
http://www.csharp-station.com
"Geri Reshef" <Ge********@Tapuz.co.il> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
Supose I have a control Text1 with todays date (21/12/2004).
How can I show it in a "yyyymmdd" format?
Solution like Text1.Value.Year.tostring() + .....Month.tostring() + ..... Day.tostring() seems to be unelegant..