{today} vs {date_created} [RESOLVED]

Hey @user648c88d38f0fe544,

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:

  1. Use echo esc_html( $form_data['date_created_usa'] ); to display the submission date in the format m/d/Y
  2. Swap the date() function for wp_date(), which will convert your UTC timestamp to your website’s local date
  3. Remove the PHP code and output the {date_created:format:m/d/Y} merge tag

All the best with your project.

1 Like