fix more time conversion bugs, allow updatedatabase.php to be run more than once