Skip to content

localtime.xml Change the parameter name + nits #4820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions reference/intl/dateformatter/localtime.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<methodparam choice="opt"><type>int</type><parameter role="reference">offset</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
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 $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.
</para>
</refsect1>

Expand All @@ -39,42 +39,41 @@ $parse_pos and consuming as much of the input value as possible.
<term><parameter>formatter</parameter></term>
<listitem>
<para>
The formatter resource
The formatter resource.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<para>
string to convert to a time
String to convert to a time.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>offset</parameter></term>
<listitem>
<para>
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 &gt; strlen($value), the parse fails immediately.
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 &gt; strlen($string), the parse fails immediately.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>


<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Localtime compatible array of integers : contains 24 hour clock value in tm_hour field,
&return.falseforfailure;.
</para>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example>
Expand All @@ -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) {
Expand All @@ -107,14 +108,17 @@ if ($arr) {
<programlisting role="php">
<![CDATA[
<?php

$fmt = new IntlDateFormatter(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);

$arr = $fmt->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) {
Expand Down