added getDateFromDb method