A
A
Alexey2017-04-13 22:58:22
MySQL
Alexey, 2017-04-13 22:58:22

How to recognize the date and automatically add it to the Wordpress calendar?

There is an automatic data import in Wordpress + Woocommerce.
Import into product attribute named "date".
Data is written to it in the form of a date, but different products have a different format for this date, and somewhere the time is added - 06/24/2017, 02/03/2018 14:30:00, 2017-11-21 19:00: 00, 2017-04-07T01:00:00Z.
How to recognize different date formats, cut off all unnecessary and enter this data into the calendar, so that later you can sort products by date? This is real?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2017-04-14
@alexey66

php.net/manual/en/function.strtotime.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question