bp_core_current_time

Get the current GMT time to save into the DB.

Description

(string) bp_core_current_time( (constant) $gmt = true, (string) $type = 'mysql' ); 

Returns (string)

Current time in 'Y-m-d h:i:s' format.

Parameters (2)

0. $gmt — Optional. (constant) => true
True to use GMT (rather than local) time. Default: true.
1. $type — Optional. (string) => 'mysql'
The type.

Usage

  1. if ( !function_exists( 'bp_core_current_time' ) ) { 
  2. require_once '/bp-core/bp-core-functions.php'; 
  3.  
  4. // True to use GMT (rather than local) time. Default: true. 
  5. $gmt = true; 
  6.  
  7. // The type. 
  8. $type = 'mysql'; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_core_current_time($gmt, $type); 
  12.  

Defined (1)

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

/bp-core/bp-core-functions.php  
  1. function bp_core_current_time( $gmt = true, $type = 'mysql' ) { 
  2.  
  3. /** 
  4. * Filters the current GMT time to save into the DB. 
  5. * @since 1.2.6 
  6. * @param string $value Current GMT time. 
  7. */ 
  8. return apply_filters( 'bp_core_current_time', current_time( $type, $gmt ) );