How to convert a string date to a numerical date?

Hi there!

I am using WordPress.
I want to convert a string date “December 5, 2020” to a numerical date “2020/12/05”.
My code is <?php the_date();?> now, it prints out December 5, 2020.
How to improve my code to print out 2020/12/05?

That function has a $format parameter, try that.

Thank you!
I found another way to change the format of the date.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.