I’m having this same issue as well. Have tried changing return values as well as every method of parsing the date field data in php, but it always either returns empty of with January 01, 1970. The dates are correct in the WP database, so something must be happening on the return trip to the browser.
I’m having the same issue when using the date field in a repeater (the repeater is the subfield of a group).
When I use the code $date = get_sub_field('date'); and echo the variable, the string returned matches the data entry in the database (each date is different). When I convert the date using methods above such as <?php echo date("F j, Y", strtotime($date)); ?>, the strtotime is not working and Jan 1, 1970 is always returned.
In contrast, when I use the DateTime method mentioned above, only the current day’s date is returned.
Is this a bug, should DateTime be avoided in repeaters?
Viewing 7 posts - 1 through 7 (of 7 total)
The topic ‘Date Picker – date appears as 1st Jan 1970???’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users