I have a calendar control which populates a textbox.
The date is in American format e.g "MM/DD/YYYY"
I need to convert this into "YYYY-MM-DD" so that I can insert it into a MYSQL database.
ANy ideas ?
I hate dates
TIA
Printable View
I have a calendar control which populates a textbox.
The date is in American format e.g "MM/DD/YYYY"
I need to convert this into "YYYY-MM-DD" so that I can insert it into a MYSQL database.
ANy ideas ?
I hate dates
TIA
Try this :
VB Code:
TextBox1.Text() = Format(Now.Today(), "MM,dd,yyyy")
You never seem to let me down Pirate.
Cheers :-)
Just my 2 cents worth but I picked this up from the net last week - you can specify the date formatting after the ".tostring" call for another time...
Now.ToString("dd/mm/yyyy")
Couldn't you just assign the date value to the OleDbCommand object and let ADO.NET do the rest for you?VB Code:
.Parameters.Add(New OleDb.OleDbParameter("@MyBirthdateField", OleDbType.Date))