I have a form that has an html field in it to display today’s date. We need to display this to the site user as they fill out the form. It is entered as:
<div>{today:format:m/d/Y}</div>
We also use Gravity PDF to create a PDF of each entry. In the PDF I use the entry date of that entry, entered in the template as:
$membership_date = strtotime(rgar( $entry, 'date_created' ));
echo date("m-d-Y", $membership_date);
This has worked fine for us for months. However, we are troubleshooting another issue, and sent through test entries yesterday on 9/11/24, and the entry date reflects this when looking at the entries in the GF → Forms → Form → Entries. However, the system is generating the PDF and the $membership_date renders in the PDF as having a date of 9/12/24. This has only happened on the 3 tests entries created on 9/11/24, between 7-8pm Central Time/Chicago. Our site’s timezone is also set to Chicago/Central Time.
Is there anything wrong with using the above code in the manner that I’ve described here? Or, should I be using {date_created} instead of {today} in the form builder admin where I’ve set the html field to contain the {today} variable?
I looked through the doc pages for {today} and {date_created}, but I could not see anything that would imply it could be causing this issue.
Last, I sent through another test today and the date rendered just fine.