What i have is a string that is ISO 8601 and I’m trying to insert it into a MySql table. The table takes the date fine but does not recognize the time.
string myTime = “3/8/2011 5:36:54 PM” (this comes in ISO 8601 format).
string mytimeFormat = myTime.ToString(“yyyy-MM-dd HH:MM:SS”);
and a basic insert into mysql statement. The MySql table shows the date correctly, just not the time. Any tips?
When i convert it using the string mytimeFormat it looks like ‘2011-03-08 17:36:54’ This is where MySql accepts the date just not the time.
You will need to convert the string to a DateTime first, so the formatting can done properly.
Update: In the format, a uppercase
Mis the month placeholder, use a lowercasemto get the minute: