Skip to content
Advertisement

Show created and modified product date on WooCommerce pages

I’m looking for solution to display products current date on the shop page.

I have tried with this, but it shows nothing at all

JavaScript

Any help is appreciated.

Advertisement

Answer

The following code shows the date the product was created and modified on the single product page and archive/Shop page

Note: the time/date display can be adjusted based on DateTime::format PHP function.

Currently used:

  • Y – A full numeric representation of a year, 4 digits
  • m – Numeric representation of a month, with leading zeros
  • d – Day of the month, 2 digits with leading zeros
  • H – 24-hour format of an hour with leading zeros
  • i – Minutes with leading zeros
  • s – Seconds with leading zeros

So you get:

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