Skip to content

Instantly share code, notes, and snippets.

@ayhanmalkoc
ayhanmalkoc / Create display date range from two dates in ACF in Wordpress
Last active June 1, 2022 10:01
Create display date range from two dates in ACF in Wordpress
<?php
$start_date = strtotime (get_field('start_date'));
$end_date = strtotime (get_field('end_date'));
if ( $start_date == $end_date ){
// the start and end are equal "d F Y" #1
echo date_i18n( "j F, l Y", $start_date );
} else {