_format_date(): added ability to pass custom format