bb_offset_time

The BuddyPress bb offset time function.

Description

bb_offset_time( $time, (null) $args = null ); 

Parameters (2)

0. $time
The time.
1. $args — Optional. (null) => null
The args.

Usage

  1. if ( !function_exists( 'bb_offset_time' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-core.php'; 
  3.  
  4. // The time. 
  5. $time = null; 
  6.  
  7. // The args. 
  8. $args = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_offset_time($time, $args); 
  12.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-includes/functions.bb-core.php  
  1. function bb_offset_time( $time, $args = null ) { 
  2. if ( isset($args['format']) && 'since' == $args['format'] ) 
  3. return $time; 
  4. if ( !is_numeric($time) ) { 
  5. if ( -1 !== $_time = bb_gmtstrtotime( $time ) ) 
  6. return gmdate('Y-m-d H:i:s', $_time + bb_get_option( 'gmt_offset' ) * 3600); 
  7. else 
  8. return $time; // Perhaps should return -1 here 
  9. } else { 
  10. return $time + bb_get_option( 'gmt_offset' ) * 3600;