Mistery1
Nov 20, 2009, 05:19 AM
Hi there,
I know MySql is already to take YYYY-MM-DD HH:MM:SS. Therefore I need to write code to change this format when saving into MySql database from my asp.net/vb application.
I have this code that does not work. It still saves as all zeros to the database. Does anyone have any clue hot to change this format to dd-mm-yyyy in the database?
Dim dateStr As String
dateStr = DateTime.Now.Month & "-"
dateStr &= DateTime.Now.Day & "-"
dateStr &= DateTime.Now.Year & " "
dateStr &= DateTime.Now.Hour & ":"
dateStr &= DateTime.Now.Minute & ":"
dateStr &= DateTime.Now.Second &
I know MySql is already to take YYYY-MM-DD HH:MM:SS. Therefore I need to write code to change this format when saving into MySql database from my asp.net/vb application.
I have this code that does not work. It still saves as all zeros to the database. Does anyone have any clue hot to change this format to dd-mm-yyyy in the database?
Dim dateStr As String
dateStr = DateTime.Now.Month & "-"
dateStr &= DateTime.Now.Day & "-"
dateStr &= DateTime.Now.Year & " "
dateStr &= DateTime.Now.Hour & ":"
dateStr &= DateTime.Now.Minute & ":"
dateStr &= DateTime.Now.Second &