I want to store the current date & time which can be get by System.DateTime.Now
in asp.net
but while storing in Mysql it gives Error of Invalid Time.
views:
25answers:
3
A:
why don't you use the MySQL now() function?
insert into mytable
( id, MyDate )
values ( 42, now() )
If that is not possible, you will need to look into converting the client side date format into something the DB will understand.
lexu
2010-03-25 09:32:59
+1
A:
MySql stores DateTimes in the format 'YYYY-MM-DD HH:MM:SS'
So you need to do
System.DateTime.Now.ToString("YYYY-mm-dd HH:MM:SS");
Nick Allen - Tungle139
2010-03-25 09:33:49