Home › Forums › Back End › Human time difference – won't work › Reply To: Human time difference – won't work
@chrisburton OK so i’ve tried this:
$cb_date = ‘<i class=”fa fa-clock-o”></i> <time class=”updated” datetime=”‘ . human_time_diff(get_the_time(‘Y-m-d’, $cb_post_id)) . ‘”>’ . date_i18n( get_option(‘date_format’), strtotime(human_time_diff(get_the_time(“Y-m-d”, $cb_post_id ))) ) . ‘</time>‘;
Which resulted in ‘unexpected ;’, and i’ve tried this:
$cb_date = ‘<i class=”fa fa-clock-o”></i> <time class=”updated” datetime=”‘ . human_time_diff(‘Y-m-d’, $cb_post_id) . ‘”>’ . date_i18n( get_option(‘date_format’), strtotime(human_time_diff(“Y-m-d”, $cb_post_id ))) . ‘</time>‘;
Which also resulted in an error. Am i fundamentally on the right tracks here? I just want it to display X minutes / hours / days ago !
Also, on a side note, a lot of tutorials say that I should be looking for <?php echo the_time() or something to that effect – but it is nowhere in my theme. What is the reason for this?
Thanks for your help.