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.DateTime'
My line of code was:
ConfirmStartTimeLabel.Text=((DateTime)(StartTimeTe xtBox.Text)).ToString("dddd,
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.mvps.orgwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
"Andy B" <a_*****@sbcglobal.netwrote in message
news:uV**************@TK2MSFTNGP04.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.tostring("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)(TextBox1.Text)).ToString("dd/MM/yyyy");