Index: bp-activity.php
===================================================================
--- bp-activity.php	(revision 3130)
+++ bp-activity.php	(working copy)
@@ -626,20 +626,20 @@
 	global $bp, $wpdb;
 
 	$defaults = array(
-		'id' => false, // Pass an existing activity ID to update an existing entry.
+		'id'                => false, // Pass an existing activity ID to update an existing entry.
 
-		'action' => '', // The activity action - e.g. "Jon Doe posted an update"
-		'content' => '', // Optional: The content of the activity item e.g. "BuddyPress is awesome guys!"
+		'action'            => '', // The activity action - e.g. "Jon Doe posted an update"
+		'content'           => '', // Optional: The content of the activity item e.g. "BuddyPress is awesome guys!"
 
-		'component' => false, // The name/ID of the component e.g. groups, profile, mycomponent
-		'type' => false, // The activity type e.g. activity_update, profile_updated
-		'primary_link' => '', // Optional: The primary URL for this item in RSS feeds (defaults to activity permalink)
+		'component'         => false, // The name/ID of the component e.g. groups, profile, mycomponent
+		'type'              => false, // The activity type e.g. activity_update, profile_updated
+		'primary_link'      => '', // Optional: The primary URL for this item in RSS feeds (defaults to activity permalink)
 
-		'user_id' => $bp->loggedin_user->id, // Optional: The user to record the activity for, can be false if this activity is not for a user.
-		'item_id' => false, // Optional: The ID of the specific item being recorded, e.g. a blog_id
+		'user_id'           => $bp->loggedin_user->id, // Optional: The user to record the activity for, can be false if this activity is not for a user.
+		'item_id'           => false, // Optional: The ID of the specific item being recorded, e.g. a blog_id
 		'secondary_item_id' => false, // Optional: A second ID used to further filter e.g. a comment_id
-		'recorded_time' => gmdate( "Y-m-d H:i:s" ), // The GMT time that this activity was recorded
-		'hide_sitewide' => false // Should this be hidden on the sitewide activity stream?
+		'recorded_time'     => bp_core_current_time(), // The GMT time that this activity was recorded
+		'hide_sitewide'     => false // Should this be hidden on the sitewide activity stream?
 	);
 
 	$params = wp_parse_args( $args, $defaults );
Index: bp-blogs.php
===================================================================
--- bp-blogs.php	(revision 3132)
+++ bp-blogs.php	(working copy)
@@ -213,7 +213,7 @@
 		'type' => false,
 		'item_id' => false,
 		'secondary_item_id' => false,
-		'recorded_time' => gmdate( "Y-m-d H:i:s" ),
+		'recorded_time' => bp_core_current_time(),
 		'hide_sitewide' => false
 	);
 
@@ -338,7 +338,7 @@
 
 	bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'name', $name );
 	bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'description', $description );
-	bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
+	bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'last_activity', bp_core_current_time() );
 
 	/* Only record this activity if the blog is public */
 	if ( (int)$_POST['blog_public'] && !$no_activity ) {
@@ -425,7 +425,7 @@
 	} else
 		bp_blogs_remove_post( $post_id, $blog_id );
 
-	bp_blogs_update_blogmeta( $blog_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
+	bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() );
 
 	do_action( 'bp_blogs_new_blog_post', $post_id, $post, $user_id );
 }
@@ -493,7 +493,7 @@
 		) );
 
 		// Update the blogs last active date
-		bp_blogs_update_blogmeta( $blog_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
+		bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() );
 	}
 
 	return $recorded_comment;
Index: bp-core.php
===================================================================
--- bp-core.php	(revision 3133)
+++ bp-core.php	(working copy)
@@ -1289,19 +1289,18 @@
 }
 
 /**
- * bp_core_format_time()
+ * bp_core_current_time()
+ *
+ * Get the current GMT time to save into the DB
+ *
+ * @package BuddyPress Core
+ * @since 1.2.6
  */
-function bp_core_format_time( $time, $just_date = false ) {
-	if ( !$time )
-		return false;
+function bp_core_current_time() {
+	// Get current time in MYSQL format
+	$current_time = current_time( 'mysql', true );
 
-	$date = date( "F j, Y ", $time );
-
-	if ( !$just_date ) {
-		$date .= __('at', 'buddypress') . date( ' g:iA', $time );
-	}
-
-	return $date;
+	return apply_filters( 'bp_core_current_time', $current_time );
 }
 
 /**
@@ -1399,16 +1398,16 @@
  * @return str The time since.
  */
 function bp_core_time_since( $older_date, $newer_date = false ) {
+
 	// array of time period chunks
-
 	$chunks = array(
-	array( 60 * 60 * 24 * 365 , __( 'year', 'buddypress' ), __( 'years', 'buddypress' ) ),
-	array( 60 * 60 * 24 * 30 , __( 'month', 'buddypress' ), __( 'months', 'buddypress' ) ),
-	array( 60 * 60 * 24 * 7, __( 'week', 'buddypress' ), __( 'weeks', 'buddypress' ) ),
-	array( 60 * 60 * 24 , __( 'day', 'buddypress' ), __( 'days', 'buddypress' ) ),
-	array( 60 * 60 , __( 'hour', 'buddypress' ), __( 'hours', 'buddypress' ) ),
-	array( 60 , __( 'minute', 'buddypress' ), __( 'minutes', 'buddypress' ) ),
-	array( 1, __( 'second', 'buddypress' ), __( 'seconds', 'buddypress' ) )
+		array( 60 * 60 * 24 * 365 , __( 'year', 'buddypress' ), __( 'years', 'buddypress' ) ),
+		array( 60 * 60 * 24 * 30 , __( 'month', 'buddypress' ), __( 'months', 'buddypress' ) ),
+		array( 60 * 60 * 24 * 7, __( 'week', 'buddypress' ), __( 'weeks', 'buddypress' ) ),
+		array( 60 * 60 * 24 , __( 'day', 'buddypress' ), __( 'days', 'buddypress' ) ),
+		array( 60 * 60 , __( 'hour', 'buddypress' ), __( 'hours', 'buddypress' ) ),
+		array( 60 , __( 'minute', 'buddypress' ), __( 'minutes', 'buddypress' ) ),
+		array( 1, __( 'second', 'buddypress' ), __( 'seconds', 'buddypress' ) )
 	);
 
 	if ( !is_numeric( $older_date ) ) {
@@ -1420,7 +1419,7 @@
 
 	/* $newer_date will equal false if we want to know the time elapsed between a date and the current time */
 	/* $newer_date will have a value if we want to work out time elapsed between two known dates */
-	$newer_date = ( !$newer_date ) ? gmmktime( gmdate( 'H' ), gmdate( 'i' ), gmdate( 's' ), gmdate( 'n' ), gmdate( 'j' ), gmdate( 'Y' ) ) : $newer_date;
+	$newer_date = ( !$newer_date ) ? strtotime( bp_core_current_time() ) : $newer_date;
 
 	/* Difference in seconds */
 	$since = $newer_date - $older_date;
@@ -1488,8 +1487,11 @@
 	if ( !is_numeric( $activity ) )
 		$activity = strtotime( $activity );
 
-	if ( '' == $activity || strtotime( gmdate( "Y-m-d H:i:s" ) ) >= strtotime( '+5 minutes', $activity ) )
-		update_usermeta( $bp->loggedin_user->id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
+	// Get current time with gmt offset
+	$current_time = bp_core_current_time();
+
+	if ( '' == $activity || strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) )
+		update_usermeta( $bp->loggedin_user->id, 'last_activity', $current_time );
 }
 add_action( 'wp_head', 'bp_core_record_activity' );
 
Index: bp-core/bp-core-classes.php
===================================================================
--- bp-core/bp-core-classes.php	(revision 3130)
+++ bp-core/bp-core-classes.php	(working copy)
@@ -424,10 +424,10 @@
 
 		if ( $this->id ) {
 			// Update
-			$sql = $wpdb->prepare( "UPDATE {$bp->core->table_name_notifications} SET item_id = %d, secondary_item_id = %d, user_id = %d, component_name = %s, component_action = %d, date_notified = FROM_UNIXTIME(%d), is_new = %d ) WHERE id = %d", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new, $this->id );
+			$sql = $wpdb->prepare( "UPDATE {$bp->core->table_name_notifications} SET item_id = %d, secondary_item_id = %d, user_id = %d, component_name = %s, component_action = %d, date_notified = %s, is_new = %d ) WHERE id = %d", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new, $this->id );
 		} else {
 			// Save
-			$sql = $wpdb->prepare( "INSERT INTO {$bp->core->table_name_notifications} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified, is_new ) VALUES ( %d, %d, %d, %s, %s, FROM_UNIXTIME(%d), %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new );
+			$sql = $wpdb->prepare( "INSERT INTO {$bp->core->table_name_notifications} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified, is_new ) VALUES ( %d, %d, %d, %s, %s, %s, %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new );
 		}
 
 		if ( !$result = $wpdb->query( $sql ) )
Index: bp-core/bp-core-notifications.php
===================================================================
--- bp-core/bp-core-notifications.php	(revision 3130)
+++ bp-core/bp-core-notifications.php	(working copy)
@@ -4,7 +4,7 @@
 	global $bp;
 
 	if ( !$date_notified )
-		$date_notified = time();
+		$date_notified = bp_core_current_time();
 
 	$notification = new BP_Core_Notification;
 	$notification->item_id = $item_id;
Index: bp-core/bp-core-signup.php
===================================================================
--- bp-core/bp-core-signup.php	(revision 3130)
+++ bp-core/bp-core-signup.php	(working copy)
@@ -494,7 +494,7 @@
 	wp_update_user( array( 'ID' => $user_id, 'user_url' => bp_core_get_user_domain( $user_id, sanitize_title( $user_login ), $user_login ), 'display_name' => bp_core_get_user_displayname( $user_id ) ) );
 
 	/* Add a last active entry */
-	update_usermeta( $user_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
+	update_usermeta( $user_id, 'last_activity', bp_core_current_time() );
 
 	/* Set the password on multisite installs */
 	if ( bp_core_is_multisite() && !empty( $user['meta']['password'] ) )
@@ -537,7 +537,7 @@
 		return false;
 
 	/* Add a last active entry */
-	update_usermeta( $user_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
+	update_usermeta( $user_id, 'last_activity', bp_core_current_time() );
 
 	/* Add the user's fullname to Xprofile */
 	if ( function_exists( 'xprofile_set_field_data' ) ) {
Index: bp-core/bp-core-templatetags.php
===================================================================
--- bp-core/bp-core-templatetags.php	(revision 3130)
+++ bp-core/bp-core-templatetags.php	(working copy)
@@ -840,12 +840,25 @@
 }
 
 function bp_format_time( $time, $just_date = false ) {
-	$date = date( get_option('date_format'), $time );
+	if ( !$time )
+		return false;
 
-	if ( !$just_date ) {
-		$date .= ' ' . __( 'at', 'buddypress' ) . date( ' ' . get_option('time_format'), $time );
-	}
+	// Get GMT offset from root blog
+	$root_blog_offset = get_blog_option( BP_ROOT_BLOG, 'gmt_offset' );
 
+	// Calculate offset time
+	$time_offest = $time + ( $root_blog_offset * 3600 );
+
+	// Current date (January 1, 2010)
+	$date = date( 'F j, Y ', $time_offest );
+
+	// Current time (9:50pm)
+	$time = date( ' g:iA', $time_offest );
+
+	// Should we show the time also?
+	if ( !$just_date )
+		$date .= __( 'at', 'buddypress' ) . date( ' g:iA', $time_offest );
+
 	return apply_filters( 'bp_format_time', $date );
 }
 
Index: bp-friends.php
===================================================================
--- bp-friends.php	(revision 3130)
+++ bp-friends.php	(working copy)
@@ -280,7 +280,7 @@
 		'type' => false,
 		'item_id' => false,
 		'secondary_item_id' => false,
-		'recorded_time' => gmdate( "Y-m-d H:i:s" ),
+		'recorded_time' => bp_core_current_time(),
 		'hide_sitewide' => false
 	);
 
@@ -361,7 +361,7 @@
 	$friendship->friend_user_id = $friend_userid;
 	$friendship->is_confirmed = 0;
 	$friendship->is_limited = 0;
-	$friendship->date_created = time();
+	$friendship->date_created = bp_core_current_time();
 
 	if ( $force_accept )
 		$friendship->is_confirmed = 1;
Index: bp-friends/bp-friends-classes.php
===================================================================
--- bp-friends/bp-friends-classes.php	(revision 3130)
+++ bp-friends/bp-friends-classes.php	(working copy)
@@ -60,10 +60,10 @@
 
 		if ( $this->id ) {
 			// Update
-			$result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET initiator_user_id = %d, friend_user_id = %d, is_confirmed = %d, is_limited = %d, date_created = FROM_UNIXTIME(%d) ) WHERE id = %d", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created, $this->id ) );
+			$result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET initiator_user_id = %d, friend_user_id = %d, is_confirmed = %d, is_limited = %d, date_created = %s ) WHERE id = %d", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created, $this->id ) );
 		} else {
 			// Save
-			$result = $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->friends->table_name} ( initiator_user_id, friend_user_id, is_confirmed, is_limited, date_created ) VALUES ( %d, %d, %d, %d, FROM_UNIXTIME(%d) )", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created ) );
+			$result = $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->friends->table_name} ( initiator_user_id, friend_user_id, is_confirmed, is_limited, date_created ) VALUES ( %d, %d, %d, %d, %s )", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created ) );
 			$this->id = $wpdb->insert_id;
 		}
 
@@ -202,7 +202,7 @@
 	function accept($friendship_id) {
 		global $wpdb, $bp;
 
-	 	return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET is_confirmed = 1, date_created = FROM_UNIXTIME(%d) WHERE id = %d AND friend_user_id = %d", time(), $friendship_id, $bp->loggedin_user->id ) );
+	 	return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET is_confirmed = 1, date_created = %s WHERE id = %d AND friend_user_id = %d", bp_core_current_time(), $friendship_id, $bp->loggedin_user->id ) );
 	}
 
 	function reject($friendship_id) {
Index: bp-groups.php
===================================================================
--- bp-groups.php	(revision 3130)
+++ bp-groups.php	(working copy)
@@ -1342,7 +1342,7 @@
 		'type' => false,
 		'item_id' => false,
 		'secondary_item_id' => false,
-		'recorded_time' => gmdate( "Y-m-d H:i:s" ),
+		'recorded_time' => bp_core_current_time(),
 		'hide_sitewide' => $hide_sitewide
 	);
 
Index: bp-groups/bp-groups-classes.php
===================================================================
--- bp-groups/bp-groups-classes.php	(revision 3130)
+++ bp-groups/bp-groups-classes.php	(working copy)
@@ -770,12 +770,12 @@
 	function accept_invite() {
 		$this->inviter_id = 0;
 		$this->is_confirmed = 1;
-		$this->date_modified = gmdate( "Y-m-d H:i:s" );
+		$this->date_modified = bp_core_current_time();
 	}
 
 	function accept_request() {
 		$this->is_confirmed = 1;
-		$this->date_modified = gmdate( "Y-m-d H:i:s" );
+		$this->date_modified = bp_core_current_time();
 	}
 
 	/* Static Functions */
Index: bp-messages.php
===================================================================
--- bp-messages.php	(revision 3130)
+++ bp-messages.php	(working copy)
@@ -402,7 +402,7 @@
 		'recipients' => false, // Can be an array of usernames, user_ids or mixed.
 		'subject' => false,
 		'content' => false,
-		'date_sent' => time()
+		'date_sent' => bp_core_current_time()
 	);
 
 	$r = wp_parse_args( $args, $defaults );
@@ -487,7 +487,7 @@
 		$notice = new BP_Messages_Notice;
 		$notice->subject = $subject;
 		$notice->message = $message;
-		$notice->date_sent = time();
+		$notice->date_sent = bp_core_current_time();
 		$notice->is_active = 1;
 		$notice->save(); // send it.
 
Index: bp-messages/bp-messages-classes.php
===================================================================
--- bp-messages/bp-messages-classes.php	(revision 3130)
+++ bp-messages/bp-messages-classes.php	(working copy)
@@ -243,7 +243,7 @@
 	function bp_messages_message( $id = null ) {
 		global $bp;
 
-		$this->date_sent = time();
+		$this->date_sent = bp_core_current_time();
 		$this->sender_id = $bp->loggedin_user->id;
 
 		if ( $id ) {
@@ -288,7 +288,7 @@
 		}
 
 		// First insert the message into the messages table
-		if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_messages} ( thread_id, sender_id, subject, message, date_sent ) VALUES ( %d, %d, %s, %s, FROM_UNIXTIME(%d) )", $this->thread_id, $this->sender_id, $this->subject, $this->message, $this->date_sent ) ) )
+		if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_messages} ( thread_id, sender_id, subject, message, date_sent ) VALUES ( %d, %d, %s, %s, %s )", $this->thread_id, $this->sender_id, $this->subject, $this->message, $this->date_sent ) ) )
 			return false;
 
 		if ( $new_thread ) {
@@ -387,7 +387,7 @@
 		do_action( 'messages_notice_before_save', $this );
 
 		if ( !$this->id ) {
-			$sql = $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_notices} (subject, message, date_sent, is_active) VALUES (%s, %s, FROM_UNIXTIME(%d), %d)", $this->subject, $this->message, $this->date_sent, $this->is_active );
+			$sql = $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_notices} (subject, message, date_sent, is_active) VALUES (%s, %s, %s, %d)", $this->subject, $this->message, $this->date_sent, $this->is_active );
 		} else {
 			$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_notices} SET subject = %s, message = %s, is_active = %d WHERE id = %d", $this->subject, $this->message, $this->is_active, $this->id );
 		}
Index: bp-themes/bp-default/_inc/ajax.php
===================================================================
--- bp-themes/bp-default/_inc/ajax.php	(revision 3130)
+++ bp-themes/bp-default/_inc/ajax.php	(working copy)
@@ -187,7 +187,7 @@
 				</div>
 
 				<div class="acomment-meta">
-					<?php echo bp_core_get_userlink( bp_get_activity_user_id() ) ?> &middot; <?php printf( __( '%s ago', 'buddypress' ), bp_core_time_since( gmdate( "Y-m-d H:i:s" ) ) ) ?> &middot;
+					<?php echo bp_core_get_userlink( bp_get_activity_user_id() ) ?> &middot; <?php printf( __( '%s ago', 'buddypress' ), bp_core_time_since( bp_core_current_time() ) ) ?> &middot;
 					<a class="acomment-reply" href="#acomment-<?php bp_activity_id() ?>" id="acomment-reply-<?php echo attribute_escape( $_POST['form_id'] ) ?>"><?php _e( 'Reply', 'buddypress' ) ?></a>
 					 &middot; <a href="<?php echo wp_nonce_url( $bp->root_domain . '/' . $bp->activity->slug . '/delete/' . bp_get_activity_id() . '?cid=' . $comment_id, 'bp_activity_delete_link' ) ?>" class="delete acomment-delete confirm"><?php _e( 'Delete', 'buddypress' ) ?></a>
 				</div>
Index: bp-xprofile.php
===================================================================
--- bp-xprofile.php	(revision 3130)
+++ bp-xprofile.php	(working copy)
@@ -484,7 +484,7 @@
 		'type' => false,
 		'item_id' => false,
 		'secondary_item_id' => false,
-		'recorded_time' => gmdate( "Y-m-d H:i:s" ),
+		'recorded_time' => bp_core_current_time(),
 		'hide_sitewide' => false
 	);
 
