I am using the Calendar form field type and am experiencing an odd result. I am passing in a date of 03/23/2016 as a string and it is instead showing 03/22/2016. This is true for all dates I have tested. They are always displayed 1 day earlier than the input I provided (e.g. 05/31/2016 will render as 05/30/2016). Here is how I am rendering the field:
<?php $myDate = '03/23/2016'; echo $this->form->getInput('date', null, $myDate); ?>
And here is the XML for that field:
<field description="COM_MYCOMPONENT_FORM_WEBINAR_DATE_DESC" format="%m/%d/%Y" label="COM_MYCOMPONENT_FORM_WEBINAR_DATE_LBL" name="date" type="calendar" />
If I print the date to the screen, it is the correct date. It is only when I put it into the calendar field that it reverts back one day. Any idea why this might be occurring and how I can fix it?