snipt

Ctrl+h for KB shortcuts

PHP

Localize dates in Wordpress

1
2
3
<?php 
echo date_i18n(get_option('date_format') ,strtotime("11/15-1976"));
?>
https://snipt.net/embed/e7b487b882a71fd1dbf55f6c235b3df1/
/raw/e7b487b882a71fd1dbf55f6c235b3df1/
e7b487b882a71fd1dbf55f6c235b3df1
php
PHP
3
2019-07-19T07:40:22
True
False
False
Dec 11, 2013 at 07:25 AM
/api/public/snipt/99832/
localize-dates-in-wordpress
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="k">echo</span> <span class="nx">date_i18n</span><span class="p">(</span><span class="nx">get_option</span><span class="p">(</span><span class="s1">&#39;date_format&#39;</span><span class="p">)</span> <span class="p">,</span><span class="nb">strtotime</span><span class="p">(</span><span class="s2">&quot;11/15-1976&quot;</span><span class="p">));</span> </span><span id="L-3"><a name="L-3"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
date, localize, wordpress, wp