Hi... Good idea but when I tried the following line of code I ended up with
this: Compiler Error Message: CS0030: Cannot convert type 'string' to
'System.DateTim e'
My line of code was:
ConfirmStartTim eLabel.Text=((D ateTime)(StartT imeTextBox.Text )).ToString("dd dd,
MMMM d yyyy h:mmtt");
All i need to do is take a string that looks like this: 01/01/2008 12:00 PM
and format it to look like a better date. I have the date format strings I
want already...it's just figuring out how to format the string that way
since it isn't actually a date.
"Leon Mayne" <le**@rmvme.mvp s.orgwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
"Andy B" <a_*****@sbcglo bal.netwrote in message
news:uV******** ******@TK2MSFTN GP04.phx.gbl...
>>I need to take the value of a textbox and format it in a more readable
date. How do you do this? I tried textbox.text.to string("date format
string") but the compiler doesnt like that idea... any ideas?
A bit dirty, but you could cast it to a date and then format it, e.g.
VB:
CDate(TextBox1. Text).ToString( "dd/MM/yyyy")
C#:
((DateTime)(Tex tBox1.Text)).To String("dd/MM/yyyy");