_bb_time_function_return

The BuddyPress bb time function return function.

Description

_bb_time_function_return( $time, $args ); 

Parameters (2)

0. $time
The time.
1. $args
The args.

Usage

  1. if ( !function_exists( '_bb_time_function_return' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.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_time_function_return($time, $args); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function _bb_time_function_return( $time, $args ) { 
  2. $time = bb_gmtstrtotime( $time ); 
  3.  
  4. switch ( $format = $args['format'] ) : 
  5. case 'since' : 
  6. return bb_since( $time, $args['more'] ); 
  7. break; 
  8. case 'timestamp' : 
  9. $format = 'U'; 
  10. break; 
  11. case 'mysql' : 
  12. $format = 'Y-m-d H:i:s'; 
  13. break; 
  14. case 'datetime' : 
  15. $format = bb_get_option( 'datetime_format' ); 
  16. break; 
  17. endswitch; 
  18.  
  19. return $args['localize'] ? bb_gmdate_i18n( $format, $time ) : gmdate( $format, $time );