changed how time is inputted to database
added sql