hello all
I try to store DateTime to mysql ,
but when i open the table in mysql command line I see that
the hour is decrease 12 by it self ,
why this can happen ,?

my insert command is
insert = "Insert into Table1(DtIn)values('"+ hin.ToString("yyyy,MM,dd,HH,mm,ss")+"')";;

hope someone help
thank you

Recommended Answers

All 4 Replies

Did you display the string 'insert' before you did the insert to see what values it had?

yes.it display correcly ,it iis mysql which decrease the value by 12.
if I insert it with command:

insert = "Insert into Table1(DtIn)values('"+ hin +"')";;

then error message said that the value is incorrect if hour value is above 12
and it give no error if hour value is under 12
how to overcome this problem

thank you

How is your table defined? Are you using MySqlCommand or OleDB?

hi all
I have found the solution
I just wrote the command string wrong ly
After I fix it it save correctly

thank you all

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.