- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
public function timeDiff( $time, $now = null ) {
if ( ! is_int( $time ) )
$time = strtotime( (string) $time ) + ( get_option( 'gmt_offset' ) * 3600 - 10800 );
if ( is_null( $now ) )
$now = time();
if ( $now == $time )
return __( 'right now', Challonge_Plugin::TEXT_DOMAIN );
if ( $now < $time )
/* translators:
%s is an approximate relative amount of time (eg. "2 days")
*/
return sprintf( __( 'in %s', Challonge_Plugin::TEXT_DOMAIN ), human_time_diff( $time, $now ) );
/* translators:
%s is an approximate relative amount of time (eg. "2 days")
*/
return sprintf( __( '%s ago', Challonge_Plugin::TEXT_DOMAIN ), human_time_diff( $time, $now ) );
}