Skip to content
Advertisement

WP All Import Pro Function To Change Date And Time Format (From Imported .CSV)

I have a .csv file which I import in my WordPress website using WP All Import Pro. Everything works fine but since I need the date to be in a different format then it comes in the .csv, and seperate the time from the date, and the date from the time I was wondering how to do this.

JavaScript

I’m not an expert in php, but I’m willing to learn. Someone who can steer me in the right direction?

Advertisement

Answer

Solved my own question. You can use Strtotime and echo it as date. It wil convert the date as needed.

JavaScript

Edit: Must replace string when using strtotime with date. 08/11/2020 17:14 (has /)

Should be:

JavaScript

For the correct format.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement