Archived topic
how to show timer last updated post
5 replies · Started by Gulshan on December 14, 2021
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
Hi Gulshan,
This should help to show the last updated date:
https://docs.generatepress.com/article/show-the-updated-post-date/
For the time format, you can change it at settings > General:
https://wordpress.org/support/article/formatting-date-and-time/
Let me know if you need further assistance :)
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.