Added getLastXDays functionality. Also added start and end time in milliseconds fields to the database.