Hi
MySqlCommand myCommand = new MySqlCommand("Insert into attendance (attendance_id,employee_id,punchin_time) values(" + 10 + "," + empno + "," + "Now()" + ")", con);
myCommand.ExecuteNonQuery();
IT is working fine . DateTime is correctly stored in Database . I want to know whether this will store Server Date&Time or Client Machine . I want Server Date&Time.
Thanks
Loading
Prabhu RajaPosted Sep 6, 2011, 5:06 AM
You doesn't mention which database you're using. I think you using MySql Database.
For MySql Database your Select Query (now() function) Will Store Server Date and time, or if you're using Sql Server Database ,then use GetDate() funtion .
NarayanPosted Sep 6, 2011, 3:46 AM