From a3c057cf70aee52bafe3c31ba1ccdb39fbd43cc0 Mon Sep 17 00:00:00 2001 From: Mikhail Alferov Date: Tue, 12 Aug 2025 15:54:49 +0300 Subject: [PATCH 1/2] localtime.xml Change the parameter name + nits It looks like the name `$parse_pos` migrated from the source code. It is better to leave the name `$offset` in the user land --- reference/intl/dateformatter/localtime.xml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/reference/intl/dateformatter/localtime.xml b/reference/intl/dateformatter/localtime.xml index 8260e20578d5..47e647a2ff03 100644 --- a/reference/intl/dateformatter/localtime.xml +++ b/reference/intl/dateformatter/localtime.xml @@ -26,8 +26,8 @@ intoffset&null; - Converts string $value to a field-based time value ( an array of various fields), starting at -$parse_pos and consuming as much of the input value as possible. + Converts string $value to a field-based time value (an array of various fields), starting at + $offset and consuming as much of the input value as possible. @@ -39,7 +39,7 @@ $parse_pos and consuming as much of the input value as possible. formatter - The formatter resource + The formatter resource. @@ -47,7 +47,7 @@ $parse_pos and consuming as much of the input value as possible. string - string to convert to a time + String to convert to a time. @@ -56,9 +56,9 @@ $parse_pos and consuming as much of the input value as possible. Position at which to start the parsing in $value (zero-based). - If no error occurs before $value is consumed, $parse_pos will contain -1 - otherwise it will contain the position at which parsing ended . - If $parse_pos > strlen($value), the parse fails immediately. + If no error occurs before $value is consumed, $offset will contain -1 + otherwise it will contain the position at which parsing ended. + If $offset > strlen($value), the parse fails immediately. @@ -66,7 +66,6 @@ $parse_pos and consuming as much of the input value as possible. - &reftitle.returnvalues; @@ -74,7 +73,7 @@ $parse_pos and consuming as much of the input value as possible. &return.falseforfailure;. - + &reftitle.examples; @@ -90,7 +89,9 @@ $fmt = datefmt_create( 'America/Los_Angeles', IntlDateFormatter::GREGORIAN ); + $arr = datefmt_localtime($fmt, 'Wednesday, December 31, 1969 at 4:00:00 PM Pacific Standard Time', $offset); + echo 'First parsed output is '; if ($arr) { foreach ($arr as $key => $value) { @@ -107,6 +108,7 @@ if ($arr) { localtime('Wednesday, December 31, 1969 at 4:00:00 PM Pacific Standard Time', $offset); + echo 'First parsed output is '; if ($arr) { foreach ($arr as $key => $value) { From 581f73ad32c1fc632a76be956aae70084df9d0d9 Mon Sep 17 00:00:00 2001 From: Mikhail Alferov Date: Tue, 12 Aug 2025 15:59:41 +0300 Subject: [PATCH 2/2] Update localtime.xml Change the parameter name --- reference/intl/dateformatter/localtime.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/intl/dateformatter/localtime.xml b/reference/intl/dateformatter/localtime.xml index 47e647a2ff03..ae7fac60e2f9 100644 --- a/reference/intl/dateformatter/localtime.xml +++ b/reference/intl/dateformatter/localtime.xml @@ -26,7 +26,7 @@ intoffset&null; - Converts string $value to a field-based time value (an array of various fields), starting at + Converts string $string to a field-based time value (an array of various fields), starting at $offset and consuming as much of the input value as possible. @@ -55,10 +55,10 @@ offset - Position at which to start the parsing in $value (zero-based). - If no error occurs before $value is consumed, $offset will contain -1 + Position at which to start the parsing in $string (zero-based). + If no error occurs before $string is consumed, $offset will contain -1 otherwise it will contain the position at which parsing ended. - If $offset > strlen($value), the parse fails immediately. + If $offset > strlen($string), the parse fails immediately.