Home › Forums › General Issues › Translate date WPML › Reply To: Translate date WPML
Hi!
You’ll need to first change it to unix timestamp and then use
date_i18n function.. here’s a snippet:
<?php $timestamp = strtotime(get_field('yourdatefield')); ?>
<time datetime="<?php echo date(DATE_W3C); ?>" pubdate class="updated"><?php echo date_i18n( 'j M', $timestamp); ?></time>
The key parts here is the first row and then the date_i18n function.. Change the first parameter of date_i18n (j M) to whatever timeformat you require 🙂
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.