Ticket #4310: 4310.01.patch
File 4310.01.patch, 1.3 KB (added by , 11 years ago) |
---|
-
src/bp-core/bp-core-functions.php
759 759 * @since BuddyPress (1.2.6) 760 760 * 761 761 * @param bool $gmt True to use GMT (rather than local) time. Default: true. 762 * @param bool $unix True to use UNIX timestamp. False to use formatted date. 763 * Default: false. 762 764 * @return string Current time in 'Y-m-d h:i:s' format. 763 765 */ 764 function bp_core_current_time( $gmt = true ) { 765 // Get current time in MYSQL format 766 $current_time = current_time( 'mysql', $gmt ); 766 function bp_core_current_time( $gmt = true, $unix = false ) { 767 if ( true == $unix ) { 768 $mode = 'timestamp'; 769 } else { 770 $mode = 'mysql'; 771 } 772 773 // Get current time 774 $current_time = current_time( $mode, $gmt ); 767 775 768 776 return apply_filters( 'bp_core_current_time', $current_time ); 769 777 } … … 828 836 * a date and the current time. $newer_date will have a value if we want to 829 837 * work out time elapsed between two known dates. 830 838 */ 831 $newer_date = ( !$newer_date ) ? strtotime( bp_core_current_time()) : $newer_date;839 $newer_date = ( !$newer_date ) ? bp_core_current_time( true, true ) : $newer_date; 832 840 833 841 // Difference in seconds 834 842 $since = $newer_date - $older_date;