|
-
Sep 16th, 2003, 07:44 AM
#1
Thread Starter
Fanatic Member
Format a date in VB.net
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
-
Sep 16th, 2003, 08:58 AM
#2
Sleep mode
Try this :
VB Code:
TextBox1.Text() = Format(Now.Today(), "MM,dd,yyyy")
-
Sep 16th, 2003, 09:31 AM
#3
Thread Starter
Fanatic Member
You never seem to let me down Pirate.
Cheers :-)
-
Sep 16th, 2003, 10:14 AM
#4
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")
-
Sep 16th, 2003, 03:47 PM
#5
Frenzied Member
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))
~Peter

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|