I am using an API that analyzes a video and writes data into the database at every 5 minutes. The problem is, in the database the timing appears as seconds (300000, 600000, 900000...) instead of minutes. Is there a way for me to convert the timing into minutes before inserting it into the database?
getFrameTimeStamp = the particular minute that the video is at
//the code below means it will only write in every 5 minutes (300000)
if (has.getFrameTimeStamp() % 300000 == 0) {
using (SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\sit\Desktop\(NEW) LEA WINFORMS\28June_LessonEffectivenessAnalysis\LessonEffectivenessAnalysis\LessonEffectivenessAnalysis\LessonEffectivenessAnalysis\LessonAnalysis.mdf;Integrated Security=True")) {
conn.Open();
using (SqlCommand cmd1 = new SqlCommand("INSERT INTO TBL_VIDEO(TIMESTAMP,JOY_SCORE,SURPRISE_SCORE,ANGER_SCORE,FEAR_SCORE,SADNESS_SCORE,DISGUST_SCORE) VALUES('" + has.getFrameTimeStamp().ToString() + "','" + people.get(i).impression.emotion_response.joy_score.ToString() + "','" + people.get(i).impression.emotion_response.surprise_score.ToString() + "','" + people.get(i).impression.emotion_response.anger_score.ToString() + "','" + people.get(i).impression.emotion_response.fear_score.ToString() + "','" + people.get(i).impression.emotion_response.sadness_score.ToString() + "','" + people.get(i).impression.emotion_response.disgust_score.ToString() + "')", conn)) {
using (SqlDataReader dr = cmd1.ExecuteReader()) {
}
}
}
}