Title: Warning: date_format()
Last modified: April 3, 2022

---

# Warning: date_format()

 *  Resolved [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/warning-date_format/)
 * Im seeing about one a day of these:
    “Warning: date_format() expects parameter
   1 to be DateTimeInterface, bool given in /home/solar/public_html/inno-therm/wp-
   content/plugins/forminator/library/fields/date.php on line 1178”
 * Yes I know I could turn off warnings.
 * I am unable to reproduce the error using my contact form. It has 3 date pickers.
   Maybe visitors are not using the date picker correctly.
 * The timestamps of the warnings don’t correspond to the timestamps of sucessful
   submissions listed in the log.
 * I would be unable to run the site with plugins disabled and wait to see if the
   warning recurs.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwarning-date_format%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/warning-date_format/#post-15524826)
 * Hi [@lorro](https://wordpress.org/support/users/lorro/)
 * I hope you’re well today and thank you for contacting us!
 * I admit I didn’t come across this issue yet but a closer look at the related 
   code suggests that it’s related to date format settings. By this I mean specifically“
   configuration” rather than data submitted by member.
 * The function that returns bool that’s later used and reported by “date_format()”
   is meant to convert between standards of date formatting. Ultimately, it takes
   format from set/given format or – as a fallback – from WP settings.
 * For some reason, this fails “somewhere on the way” and I admit I’m not yet sure
   why. I tried to replicate this but to no luck.
 * For now, I’d like to ask you to start with two simple steps:
 * 1. edit your date picker field on the form and change date format in its settings,
   apply it and update the form; then clear all cache on site if there is any; then
   change the format back, apply and update and again clear cache.
 * If this doesn’t solve the issue
 * 2. try the same process (change, save, change back, save) with date format set
   in your WordPress on “Settings -> General” page.
 * I’m suggesting this because it’s possible (I’ve seen such cases) that due to 
   some temporary glitch format settings weren’t correctly saved into DB so I’d 
   like to rule that out.
 * If that’s not the case, then are you, by any chance, using some non-standard (
   custom) date format in your WordPress and if yes – what exactly is the format?
 * Kind regards,
    Adam
 *  Thread Starter [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/warning-date_format/#post-15529104)
 * Thank you for your full reply.
 * I have carried out the steps in 1. above but I will need to wait a couple of 
   days to see if they have had an effect.
 * My form has 3 date fields, I don’t know if that’s relevant.
 * The formats I have chosen in form edit are all d-m-Y
 * My WordPress date format is d/m/Y
 * Again, not sure if this is relevant, I have been using Forminator for about a
   year and these warnings have started to appear over the last couple of weeks,
   the first one was on 15/03/22.
 * I’m also seeing:
    PHP Warning: strlen() expects parameter 1 to be string, array
   given in /home/solar/public_html/inno-therm/wp-content/plugins/forminator/library/
   fields/select.php on line 417 in the error log, but there’s only a couple of 
   them.
 *  Plugin Support [Dimitris – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support6/)
 * (@wpmudev-support6)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/warning-date_format/#post-15533874)
 * Hello [@lorro](https://wordpress.org/support/users/lorro/)
 * Could you please duplicate the form, strip any sensitive information, export 
   it and share it here with us via a service like Dropbox, GDrive or Pastebin?
   
   [https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export](https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export)
 * Just so we import it in some testing sites and check if we can further replicate.
 * Thank you,
    Dimitris
 *  Thread Starter [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/warning-date_format/#post-15534008)
 * I tried 1. from Adam’s post but it made no difference. I’ve done 2. and I’m waiting
   to see if that does anything.
 * I put in some debug code just before line 1178. The result was that $date_format
   is “dd-mm-yy” which looks good, but $data was “Hqsrrvzmhwkyk” which looks completely
   wrong. I’ve put some more debug code in to see where $data is coming from, but
   as I’m unable to replicate the problem, I’ll just need to wait for it to recur.
 * If no-one else is reporting this, it looks like something just from my site. 
   I will keep trying to debug and report back if I find anything.
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/warning-date_format/#post-15537318)
 * Hi [@lorro](https://wordpress.org/support/users/lorro/)
 * I hope you are doing well.
 * Please keep us posted, I also suggest running a Full plugin conflict test in 
   case any plugin or theme is conflicting with the Forminator [https://wpmudev.com/docs/getting-started/getting-support/#conflict-test](https://wpmudev.com/docs/getting-started/getting-support/#conflict-test)
 * Best Regards
    Patrick Freitas
 *  Thread Starter [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/warning-date_format/#post-15556448)
 * OK, I think I’ve got to the bottom of this with some debugging. Some spammer 
   script is sending post data to the page. The post data is promoting a service
   which is not related to my site and from a country a long way off. They probably
   have a script that crawles round the internet for forms and tries their luck.
   The script half right but its not recogising all the form fields, so the submitted
   data fails validation. The spam message does not appear in the submissions list.
 * Does Forminator check that the post data comes from the host site. Anyway, going
   forward I can safely ignore these warnings.
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/warning-date_format/#post-15559378)
 * Hi [@lorro](https://wordpress.org/support/users/lorro/)
 * I hope you are doing well.
 * Thank you for the update.
 * > Does Forminator check that the post data comes from the host site
 * We do have validations & sanitization, for spam we suggest some extra security
   layers for example Akismet or honeypot the [https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#security](https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#security)
 * I am marking this as resolved, feel free to ping us any time you need.
 * Best Regards
    Patrick Freitas

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Warning: date_format()’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

## Tags

 * [date_format](https://wordpress.org/support/topic-tag/date_format/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 7 replies
 * 4 participants
 * Last reply from: [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/warning-date_format/#post-15559378)
 * Status: resolved