Home › Forums › Bug Reports › Date Picker – date appears as 1st Jan 1970??? › Reply To: Date Picker – date appears as 1st Jan 1970???
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?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.