Skip to content

Instantly share code, notes, and snippets.

@taotiwordpress
Created August 19, 2021 03:01
Show Gist options
  • Save taotiwordpress/0cc35018d8002ac00ca145095ba1e8d8 to your computer and use it in GitHub Desktop.
Save taotiwordpress/0cc35018d8002ac00ca145095ba1e8d8 to your computer and use it in GitHub Desktop.
[convert format of acf date field] #acf #php #date
$date = get_field('date_published', false, false);
$event_date = new DateTime($date);
$new_time = $event_date->format('ga');
$first_date = $event_date->format('F j, Y');
<?= $first_date; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment