How to customize the Delivery Times for WooCommerce date display format

0 minutes, 26 seconds

By default, the Delivery Times for WooCommerce plugin displays the date in the following format:

Date: Apr 19, 2020

But what if you want to display the date in a different format, something like this:

Date: 04/19/20

That’s where the built in dtwc_date_format filter comes in, making it easy to customize the date format to your specific needs.

Add the code snippet below to your theme’s functions.php file and it will change the date format.

<?php
/**
* Delivery Times for WooCommerce
*
* Change the date format (default: M j, Y)
*
* @link https://wordpress.org/plugins/delivery-times-for-woocommerce/
* @return string
*/
function acme_date_format( $format ) {
$format = 'm/d/y';
return $format;
}
add_filter( 'dtwc_date_format', 'acme_date_format' );

Was this article helpful?