Title: ACF date format
Last modified: March 21, 2019

---

# ACF date format

 *  Resolved [pipoulito](https://wordpress.org/support/users/pipoulito/)
 * (@pipoulito)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/acf-date-format/)
 * Hello,
 * When i export my ACF date (repeater) they display like this :
    20190418 whereas
   in ACF they are set like this : 18/04/2019
 * thanks for help
    -  This topic was modified 7 years, 2 months ago by [pipoulito](https://wordpress.org/support/users/pipoulito/).

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

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/acf-date-format/#post-11347972)
 * Hi [@pipoulito](https://wordpress.org/support/users/pipoulito/)
 * This is expected behavior because “20190418” is how ACF stores the date in the
   database. You can change the format using a custom PHP function on the field:
   [http://www.wpallimport.com/tour/export-developer-friendly/](http://www.wpallimport.com/tour/export-developer-friendly/).
   Example function:
 *     ```
       function my_change_date_format( $date ) {
       	if ( $obj = DateTime::createFromFormat( 'Ymd', $date ) ) {
       		return $obj->format( 'd/m/Y' );	
       	} else {
       		return null;
           }
       }
       ```
   
 * See: [https://d.pr/i/pSL9aK](https://d.pr/i/pSL9aK)
 *  Thread Starter [pipoulito](https://wordpress.org/support/users/pipoulito/)
 * (@pipoulito)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/acf-date-format/#post-11356849)
 * thanks a lot !
    But as my datefield is in a repeater field , will it work ?
    -  This reply was modified 7 years, 2 months ago by [pipoulito](https://wordpress.org/support/users/pipoulito/).
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/acf-date-format/#post-11371917)
 * Hi [@pipoulito](https://wordpress.org/support/users/pipoulito/)
 * > But as my datefield is in a repeater field , will it work ?
 * In that case you’d need to write some custom code that uses the ‘wp_all_export_csv_rows’
   hook: [https://github.com/soflyy/wp-all-import-action-reference/blob/master/all-export/wp_all_export_csv_rows.php](https://github.com/soflyy/wp-all-import-action-reference/blob/master/all-export/wp_all_export_csv_rows.php).
   Example snippet:
 *     ```
       function wp_all_export_csv_rows( $articles, $options, $export_id ) {
           foreach ($articles as $key => $article) {
               if ( ! empty( $article["A Repeating Group_date"] ) ) {
                   $dates = explode( ",", $article["A Repeating Group_date"] );
                   foreach ( $dates as $ikey => $ivalue ) {
                       $dates[ $ikey ] = my_change_date_format( $ivalue );
                   }
                   $articles[ $key ]["A Repeating Group_date"] = implode( ",", $dates );
               }
           }
           return $articles; // Return the array of records to export
       }
       add_filter( 'wp_all_export_csv_rows', 'wp_all_export_csv_rows', 10, 3 );
   
       function my_change_date_format( $date ) {
           if ( $obj = DateTime::createFromFormat( 'Ymd', $date ) ) {
               return $obj->format( 'd/m/Y' );	
           } else {
               return null;
           }
       }
       ```
   
    -  This reply was modified 7 years, 2 months ago by [WP All Import](https://wordpress.org/support/users/wpallimport/).
    -  This reply was modified 7 years, 2 months ago by [WP All Import](https://wordpress.org/support/users/wpallimport/).
 *  Thread Starter [pipoulito](https://wordpress.org/support/users/pipoulito/)
 * (@pipoulito)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/acf-date-format/#post-11377423)
 * thanks
 * muy date are names : program_0_date, program_1_date …
    So how should i replace“
   A Repeating Group_date” please ? thanks
    -  This reply was modified 7 years, 2 months ago by [pipoulito](https://wordpress.org/support/users/pipoulito/).
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/acf-date-format/#post-11380374)
 * Hey [@pipoulito](https://wordpress.org/support/users/pipoulito/)
 * When possible we’re happy to provide examples to point you in the right direction,
   but unfortunately we can’t write/adjust/troubleshoot custom code for your project
   as part of our support.

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

The topic ‘ACF date format’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-export/assets/icon-256x256.png?rev=2570162)
 * [WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel](https://wordpress.org/plugins/wp-all-export/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-export/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-export/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-export/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-export/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-export/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/acf-date-format/#post-11380374)
 * Status: resolved