fixed _format_date to use local date instead of UTC