fixing input date format for postgresql