Added functionality to time earned data to the database.