From 1440dab429b9643f9c2fd4fe6c84689b46e38ba0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 13 Dec 2019 21:43:06 +0000 Subject: [PATCH] Docs: Clarify descriptions for `get_gmt_from_date()` and `get_date_from_gmt()`. Props johnbillion, Rarst. Fixes #48650. git-svn-id: https://develop.svn.wordpress.org/trunk@46958 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/formatting.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 2ae03b1cc4..de1aedaf67 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -3497,16 +3497,16 @@ function _wp_iso_convert( $match ) { } /** - * Returns a date in the GMT equivalent. + * Given a date in the timezone of the site, returns that date in UTC timezone. * * Requires and returns a date in the Y-m-d H:i:s format. * Return format can be overridden using the $format parameter. * * @since 1.2.0 * - * @param string $string The date to be converted. + * @param string $string The date to be converted, in the timezone of the site. * @param string $format The format string for the returned date. Default 'Y-m-d H:i:s'. - * @return string GMT version of the date provided. + * @return string Formatted version of the date, in UTC timezone. */ function get_gmt_from_date( $string, $format = 'Y-m-d H:i:s' ) { $datetime = date_create( $string, wp_timezone() ); @@ -3519,16 +3519,16 @@ function get_gmt_from_date( $string, $format = 'Y-m-d H:i:s' ) { } /** - * Converts a GMT date into the correct format for the blog. + * Given a date in UTC timezone, returns that date in the timezone of the site. * * Requires and returns a date in the Y-m-d H:i:s format. * Return format can be overridden using the $format parameter. * * @since 1.2.0 * - * @param string $string The date to be converted. + * @param string $string The date to be converted, in UTC timezone. * @param string $format The format string for the returned date. Default 'Y-m-d H:i:s'. - * @return string Formatted date relative to the timezone. + * @return string Formatted version of the date, in the site's timezone. */ function get_date_from_gmt( $string, $format = 'Y-m-d H:i:s' ) { $datetime = date_create( $string, new DateTimeZone( 'UTC' ) );