Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 29348)
+++ wp-includes/formatting.php	(working copy)
@@ -2327,6 +2327,76 @@
 }
 
 /**
+ * Returns a formatted date in the local timezone. This is a drop-in
+ * replacement for `date()`, except that the returned string will be formatted
+ * for the local timezone.
+ *
+ * If there is a timezone_string available, the date is assumed to be in that
+ * timezone, otherwise it simply subtracts the value of the 'gmt_offset'
+ * option.
+ *
+ * @uses get_option() to retrieve the value of 'gmt_offset'.
+ * @param string $format The format of the outputted date string.
+ * @param string $timestamp Optional. If absent, defaults to `time()`.
+ * @return string GMT version of the date provided.
+ */
+function wp_date( $format, $timestamp = false ) {
+	$tz = get_option( 'timezone_string' );
+	if ( ! $timestamp ) {
+		$timestamp = time();
+	}
+	if ( $tz ) {
+		$date = date_create( "@$timestamp" );
+		if ( ! $date ) {
+			return gmdate( $format, 0 );
+		}
+		$date->setTimezone( new DateTimeZone( $tz ) );
+		return $date->format( $format );
+	} else {
+		return date( $format, $timestamp + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) );
+	}
+}
+
+/**
+ * Converts a locally-formatted date to a unix timestamp. This is a drop-in
+ * replacement for `strtotime()`, except that where strtotime assumes GMT, this
+ * assumes local time (as described below). If a timezone is specified, this
+ * function defers to strtotime().
+ *
+ * If there is a timezone_string available, the date is assumed to be in that
+ * timezone, otherwise it simply subtracts the value of the 'gmt_offset'
+ * option.
+ *
+ * @see strtotime()
+ * @uses get_option() to retrieve the value of 'gmt_offset'.
+ * @param string $string A date/time string. See `strtotime` for valid formats.
+ * @return int UNIX timestamp.
+ */
+function wp_strtotime( $string ) {
+	// If there's a timezone specified, we shouldn't convert it
+	try {
+		$test_date = new DateTime( $string );
+		if ( 'UTC' != $test_date->getTimezone()->getName() ) {
+			return strtotime( $string );
+		}
+	} catch ( Exception $e ) {
+		return strtotime( $string );
+	}
+
+	$tz = get_option( 'timezone_string' );
+	if ( $tz ) {
+		$date = date_create( $string, new DateTimeZone( $tz ) );
+		if ( ! $date ) {
+			return strtotime( $string );
+		}
+		$date->setTimezone( new DateTimeZone( 'UTC' ) );
+		return $date->getTimestamp();
+	} else {
+		return strtotime( $string ) - ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
+	}
+}
+
+/**
  * Adds a element attributes to open links in new windows.
  *
  * Comment text in popup windows should be filtered through this. Right now it's
