saving date and time
- by saeed talaee
I want to save the time and date within my news but in the method below I save the time of the user and if his/her time is wrong, the wrong time will be save. How can I use the server's time instead.
SqlConnection sqlconn = new SqlConnection(connStr);
SqlCommand sqlcmd = new SqlCommand("insert into SubmitManuscript(username,title,authors,type,date,upload,reviewer1,email1,reviewer2,email2,reviewer3,email3)values(@username,@title,@authors,@type,@date,@upload,@reviewer1,@email1,@reviewer2,@email2,@reviewer3,@email3)", sqlconn);
sqlcmd.Parameters.AddWithValue("@username", username);
sqlcmd.Parameters.AddWithValue("@title", Text_Title.Text);
sqlcmd.Parameters.AddWithValue("@authors", Text_Author.Text);
sqlcmd.Parameters.AddWithValue("@type", dd_Type.SelectedItem.Text);
sqlcmd.Parameters.AddWithValue("@date", DateTime.Now);
//sqlcmd.Parameters.AddWithValue("@upload", "~/Suppelment/" +