Show post date on the page

the_date() is technically the template tag to do it. However it has a somewhat unusual aspect to only output once per date, so if there are multiple posts on page from same date they won’t all show it. get_the_date() is one level lower and retrieves (not outputs) a post’s date without that bit of logic.

Display ‘modified date’ in WordPress Twenty Fourteen

Look for the code that displays the post date. It should look something like the following: Posted on: <?php the_time(‘l, F jS, Y’) ?> Now replace it with the following code (slightly modified from Ardamis’ post): Posted on <?php the_time(‘F jS, Y’) ?> <?php $u_time = get_the_time(‘U’); $u_modified_time = get_the_modified_time(‘U’); if ($u_modified_time != $u_time) { … Read more

How to hide post published date?

Add entry-date { display: none; } to the stylesheet. Better create a child theme and add the code to the newly created stylesheet, if you dont you may lose the code when you update your theme to a latest version.

How to get Unix Local Time?

Please use DateTime::getTimestamp() that returns unix timestamp. If you want to format the date according to your time zone then you try this. $datetime = new DateTime(“now”, new DateTimeZone(‘America/New York’)); echo $datetime ->format(‘m/d/Y, H:i:s’);