Hi @osipmikhail
Can you please elaborate on which date field is changing, and provide a “before” and “after” screenshot?
Sure, each record has the title set to take in the division name, the date and division number.
The excel screenshot shows what data I’m importing, the WordPress screenshot shows what happens after the data is imported. The date is in American format, the trouble is the url’s will be based in what shows in the title of the record. It won’t match because the date format is different.
http://conservativeactive.com/testing/wp-content/uploads/2017/12/data.png
http://conservativeactive.com/testing/wp-content/uploads/2017/12/data1.png
Hi @osipmikhail
I assume that you’re importing the date into a custom field or something, and that’s being used in the title – is that correct? If so, the problem is most likely that PHP’s strtotime() function assumes American date format if you use slashes. To fix this, you can change the slashes to dots using a PHP function in the import (see documentation):
[str_replace("/",".",{division_date[1]})]
If that doesn’t help, then we would need to see the data and import settings to advise further. In this case, please replicate the issue at http://www.wpallimport.com/debug/ and open a ticket at http://www.wpallimport.com/support/ withe more details so that we can help out.
Hi,
Thanks for coming back to me, appreciate considering its the holiday season.
I did the above and even though it does exactly what it was supposed to do the date is still in American format.
It was my fault not to state precisely what I was importing to, I am using the Pods plugin, the date format I have set is to dd/mm/yyyy although I’m not exactly sure if not using pre-determined format makes a difference.
If you’re importing into Custom Meta, there is no American format; dates are stored in ANSI standard of yyyy-mm-dd hh:mm:ss because the date is actually in a key/value pair
Not sure if this helps but you can see just from the import process it already has set the date to US format before even setting where the data should go to.
http://conservativeactive.com/testing/wp-content/uploads/2017/12/date.png
Sorry just saw Jim’s response.
In that case is there anything I can do?
Hey @osipmikhail
Are you using the {division_date[1]} element in the title? If so, try using this PHP function on that element to fix the format:
function my_fix_date( $date ) {
return DateTime::createFromFormat( 'n/j/Y', $date )->format( 'j/n/Y' );
}
Marking this as resolved. @osipmikhail please let us know if you still have any questions about this issue.