Title: Date Format not recognized
Last modified: June 30, 2017

---

# Date Format not recognized

 *  Resolved [mikey_mms](https://wordpress.org/support/users/mikey_mms/)
 * (@mikey_mms)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/date-format-not-recognized/)
 * Hi there,
 * I’m using Mailchimp for WP Premium and the woocommerce Integration.
    There is
   a field date (birth date) at the checkout, which I’m integrating using :
 * add_filter( ‘mc4wp_integration_woocommerce_data’, function( $data ) {
    $data[‘
   BIRTHDATE’] = sanitize_text_field( $_POST[‘birthdate’] ); return $data; });
 * The date format is in datepicker field is dd/mm/yyyy (also the format of the 
   mailchimp mergetag), but Mailchimp for WP doesn’t seem to recognize it and populate
   with yyyy/mm/dd instead (the report log item shows: DATE OF BIRTH: 1970-01-01).
   No errors are displayed though in the Debug Log though.
 * Thank you very much in advance for you help!

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

 *  Plugin Contributor [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/date-format-not-recognized/#post-9279113)
 * Hi,
 * Since a link to your form is missing from the post I can’t say for sure, but 
   I assume you are using the HTML5 date picker? It will _show _the date in whatever
   date format is set in your local browser, and it will always _send _the date 
   as yyyy/mm/dd.
 * I suggest you use PHP to convert the date in the filter code. Something like 
   this (untested):
 * add_filter( ‘mc4wp_integration_woocommerce_data’, function( $data ) {
    $originalDate
   = sanitize_text_field( $_POST[‘birthdate’] ); $newDate = date(“d-m-Y”, strtotime(
   $originalDate)); $data[‘BIRTHDATE’] = $newDate; return $data; });
 * Since you are Premium user please contact Premium support if you need more help
   so we can give you Priority support.
    [https://wordpress.org/support/topic/sticky-premium-users-please-read-this/](https://wordpress.org/support/topic/sticky-premium-users-please-read-this/)
 * Hope that helps!
 *  Thread Starter [mikey_mms](https://wordpress.org/support/users/mikey_mms/)
 * (@mikey_mms)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/date-format-not-recognized/#post-9281744)
 * Hi there,
 * It worked using your code and the Y/m/d format (format always sent) instead of
   the d-m-Y format.
 * Thank you very much for your help !
 *  Plugin Contributor [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/date-format-not-recognized/#post-9289615)
 * Thanks for letting us know!

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

The topic ‘Date Format not recognized’ is closed to new replies.

 * ![](https://ps.w.org/mailchimp-for-wp/assets/icon-256x256.png?rev=1224577)
 * [MC4WP: Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp-for-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp-for-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp-for-wp/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Lap](https://wordpress.org/support/users/lapzor/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/date-format-not-recognized/#post-9289615)
 * Status: resolved