added time formatting and fixed sqllite