Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

PHP - epoch to date with PHP substr

0 votes
16 views
added Mar 25 in PHP by LC Marshal Lieutenant (18,470 points)
<?php
// "node_created":"1553498100" get value from API
$newsdate = $row->node_created;
?>
<p class="news-date"><?php print date("F j, Y", substr($newsdate, 0, 10)); ?></p> 
// output $newsdate March 25, 2019

 

For more date function variation, learn it at PHP.net 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...