moves datetime conversion to database.py