Welcome to WebmasterWorld Guest from 174.129.151.95

Forum Moderators: open

Message Too Old, No Replies

Date Formatting MySQL yyyy-mm-dd

   
8:47 pm on Apr 13, 2010 (gmt 0)

5+ Year Member



I have asp.textbox populated by asp.Calendar Formated ShortDate. My database is MySQL5 which will only accept yyyy-mm-dd My INSERT INTO (Diarydate)VALUES ( & txtDate.Text & ) I considered using VARCHAR() or CHAR() but I need to keep the date format in the database for filtering/searching
One interesting feature in the asp.Calendar properties SelectedDate which desplays the date formatted yyyy-mm-dd is it possible to say link it to a variable to use to populate MySQL?
Or is there a method convert the textbox date to MySQL format in the INSERT string?
7:01 pm on Apr 19, 2010 (gmt 0)

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You'll probably find the MySQL Date & Time Functions [dev.mysql.com] to be quite helpful. :)

There's so many different ways to manipulate date/time information it would probably be best for you to take a look at what's available and post back if you run into trouble.