When you mark the task as complete, there are two ways you can do it: issue an SQL UPDATE with the current date from the system on which the user decides it is complete:
using (SqlCommand cmd = new SqlCommand("UPDATE MyTable SET ACompleteDate=@DT WHERE TaskID=@ID", con))
{
cmd.Parameters.AddWithValue("@ID", taskId);
cmd.Parameters.AddWithValue("@DT", DateTime.Now);
cmd.ExecuteNonQuery();
}
The other alternative is toy use the server time:
using (SqlCommand cmd = new SqlCommand("UPDATE MyTable SET ACompleteDate=GetDate() WHERE TaskID=@ID", con))
{
cmd.Parameters.AddWithValue("@ID", taskId);
cmd.ExecuteNonQuery();
}
Depends on the environment you want to work in which you want to use.