Support

Account

Home Forums ACF PRO Updating DateTime Field To Todays Date And a Fixed Time

Unread

Updating DateTime Field To Todays Date And a Fixed Time

  • I am using either the Elementor or Bricks Builder Countdown element – Elementor comes with native dynamic data option and I have some code for Bricks so both allow selecting Date Time from an ACF field. But it has to be DateTime not just time.

    My posts have an ACF field ‘Time’ and when the post is displayed I want the countdown to show for the time in the post. But the Countdown elements demand a Date and Time.

    To work with the countdown element I will store the fixed times for the posts in a DateTime field and I want to use php to update the date part of the field to the current date and leave the time portion as is.

    I have seen some code to update the entire DateTime field to current date and time.

    What is the right way to update just the date portion of a DateTime field?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.