Guest User

Untitled

a guest
Oct 15th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. human_time_diff( get_the_time('U'), current_time( 'timestamp' ) ) . ' ago';
  2.  
  3. date_default_timezone_set('Australia/Melbourne'); // set the time zone
  4. $timestamp = strtotime( $post->post_date ); // get timestamp
  5. $now = time();// get the curren time
  6. $time_passed = $timestamp - $now; // get the differnece
  7.  
  8. // display time
  9. $min = $time_passed / 60;
  10. if( $min < 60 ) {
  11. return sprintf( avantgardia__( '%s min. ago', 'newspeak' ), intval( $min) );
  12. }
Add Comment
Please, Sign In to add comment