AdvancedCustomFields / AdvancedCustomFields/acf

get_field returns -1 day on front-end value for Date field

Open
#275 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

It appears somehow that get_field is returning -1 day in some cases while the value correct:
image
image

In stead of March 2nd, it shows March 1st which is not set as the date. This does not happen with PHP's date() and DateTime.
image

Changing the output format won't make it budge, it will keep displaying -1 day.

I am running the latest versions of ACF & ACF Pro (as of today) + Elementor Pro

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the get_field entry point and reproduce the reported Date field value on the front end using the stated ACF and ACF Pro versions. Compare its result with PHP's date() and DateTime behavior, including the configured output format. Done means the selected March 2 date is returned and displayed without shifting to March 1.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.