I am trying to print PUBLISHED date or UPDATED date if post has been updated
Here is my php if statement
<?php
$u_time = the_time('U');
$u_modified_time = the_modified_time('U');
if ($u_modified_time > $u_time) {
echo "[UPDATED] "; the_modified_time('F j, Y'); echo " at "; the_modified_time(); echo " EST";}
else {
echo "[PUBLISHED] "; the_time('M jS Y'); echo " at "; the_time(); echo " EST"; }
?>
and here is what is printed
15479814021547981405[PUBLISHED] Jan 20th 2019 at 10:50 am EST
but this is what am expecting
[PUBLISHED] Jan 20th 2019 at 10:50 am EST
Not sure why this 15479814021547981405
part is being printed out
What do i do to take that part out?
Thanks
Here is what worked for the logic of showing updated post date and time if post is updated and if not just show published date and time for WORDPRESS
<?php $u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time >= $u_time + 86400) {
echo " [UPDATED] ";
the_modified_time('F j, Y');
echo " at ";
the_modified_time(); }
else {
echo get_the_date(); echo " at "; echo the_modified_time(); echo " EST";
}
?>
So anyone looking to implement this on their wordpress website. go for it!!! Solved it myself after hours of back and forth