Date-handling in db has been changed

To accommodate for searching through it with an int, and finding the
closest one without using several arraylists.