| 2692 | |
| 2693 | function bp_get_activity_feed_item_date_timezone_corrected() { |
| 2694 | global $activities_template; |
| 2695 | |
| 2696 | return apply_filters( 'bp_get_activity_feed_item_date_timezone_corrected', modify_utc_timestamp_for_local_timezone($activities_template->activity->date_recorded) ); |
| 2697 | } |
| 2698 | |
| 2699 | function modify_utc_timestamp_for_local_timezone($timestamp) { |
| 2700 | if ( $tz = bp_get_option('timezone_string') ) { |
| 2701 | $date = new DateTime( $timestamp, new DateTimeZone( 'UTC' ) ); |
| 2702 | date_timezone_set( $date, new DateTimeZone( $tz ); |
| 2703 | $timestamp = $date->format( 'Y-m-d h:i:s' ); |
| 2704 | } |
| 2705 | return $timestamp; |
| 2706 | } |