Definition:
function current_time( $type, $gmt = 0 ) {}
Parameters
- string $type: Either ‘mysql’ or ‘timestamp’.
- int|bool $gmt: Optional. Whether to use GMT timezone. Default is false.
Return values
returns:String if $type is ‘gmt’, int if $type is ‘timestamp’.
Source code
function current_time( $type, $gmt = 0 ) {
switch ( $type ) {
case 'mysql':
return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * 3600 ) ) );
break;
case 'timestamp':
return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * 3600 );
break;
}
}
754

February 11, 2011 

