Tag Info

New answers tagged

0

If you only want to work with yyyy-mm-dd strings, for example '2014-10-10', you could do something like: 'before' => '2014-10-10 + 1 day - 1 second', 'before' => '2014-10-10 + 86399 seconds', 'before' => 'tomorrow 2014-10-10 - 1 second', 'before' => '2014-10-10 tomorrow - 1 second', or just append '23:59:59' to your yyyy-mm-dd string ...


0

To print relative time on posts automatically we can use get_the_date filter. We will check the time difference and print it in human readable form. // Relative date & time function wp_relative_date() { return human_time_diff( get_the_time('U'), current_time( 'timestamp' ) ) . ' ago'; } add_filter( 'get_the_date', 'wp_relative_date' ); // for posts ...



Top 50 recent answers are included