The $entry['date_created']
is saved in UTC time and isn’t converted to your site’s local time. So anytime a form submission is made between 6pm and 11:59pm Chicago time the code you are using will display the date as tomorrow (Chicago currently being 5 hours behind UTC time).
Some options to fix this in the PDF are:
- Use
echo esc_html( $form_data['date_created_usa'] );
to display the submission date in the formatm/d/Y
- Swap the
date()
function forwp_date()
, which will convert your UTC timestamp to your website’s local date - Remove the PHP code and output the
{date_created:format:m/d/Y}
merge tag
All the best with your project.