Title: Date Format
Last modified: July 6, 2018

---

# Date Format

 *  Resolved [altpressadmin](https://wordpress.org/support/users/altpressadmin/)
 * (@altpressadmin)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/date-format-148/)
 * I have a JSON file that has this element:
 * <month>05</month>
 * And I want to use that in my post entry to display as “May” rather than the numeric
   form. I’ve tried using a custom function but when I preview it, I get this error:
 * Error parsing content: Call to undefined function “formatDate”

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

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/date-format-148/#post-10470843)
 * Hey [@altpressadmin](https://wordpress.org/support/users/altpressadmin/)
 * You can use a custom PHP function in the import for this: [http://www.wpallimport.com/documentation/developers/execute-php/](http://www.wpallimport.com/documentation/developers/execute-php/).
   Here’s an example function:
 *     ```
       function my_fix_date( $date ) {
       	if ( $date >= 01 && $date <= 12 ) {
       		if ( $obj = DateTime::createFromFormat( 'm', $date ) ) {
       			return $obj->format( 'F' );	
       		} else {
       			return null;
       		}
       	} else {
       		return null;
       	}
       }
       ```
   
 *  Thread Starter [altpressadmin](https://wordpress.org/support/users/altpressadmin/)
 * (@altpressadmin)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/date-format-148/#post-10477728)
 * [@wpallimport](https://wordpress.org/support/users/wpallimport/) – I added this
   function to my import, but it’s still displaying as a number.
 * Do I need to configure anything when I drag the month element to my content?
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/date-format-148/#post-10491634)
 * Hi [@altpressadmin](https://wordpress.org/support/users/altpressadmin/)
 * > Do I need to configure anything when I drag the month element to my content?
 * You’ll just need to make sure that you pass the month element to the function,
   for example:
 * `[my_fix_date({month[1]})]`
    -  This reply was modified 7 years, 11 months ago by [WP All Import](https://wordpress.org/support/users/wpallimport/).

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

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

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

## Tags

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

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