Site logo

Archived topic

how to show timer last updated post

5 replies · Started by Gulshan on December 14, 2021

Viewing posts 1–6 of 6

I want to show last update in the post. I want to show last update with the current date and time. i want to show last update like this website- https://sarkariprep. in/rsmssb-apro-recruitment-055/ . please check and help me. Thank You

You have not understood my question properly. I want to show the current date and time in the last update section in my post. For example, whenever a user visits any page, the last update will be shown the same day and time when he opens the post. You check the last updated format - Last Updated : Wednesday 15 - 12 - 2021 | 08:19 PM

I see, try this PHP snippet:

add_filter( 'generate_post_date_output','yh_get_current_date' );
function yh_get_current_date() {
	echo 'Last updated: '.date('l d -m - Y | g:i a').' ';
}

Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know :)

Thanks for the help,
it is working but I want to show Indian time but it is showing an international time zone. how to show Indian time.
Thanks

You can set your site's time zone at settings > general > timezone.

This archived topic is closed to new replies.