Skip to content

Commit 8ddf539

Browse files
authored
IntlDateFormatter::localtime: Fix example (closes #4636)
1 parent a0eca86 commit 8ddf539

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

reference/intl/dateformatter/localtime.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<para>
2929
Converts string $value to a field-based time value ( an array of various fields), starting at
3030
$parse_pos and consuming as much of the input value as possible.
31-
</para>
31+
</para>
3232
</refsect1>
3333

3434
<refsect1 role="parameters">
@@ -39,15 +39,15 @@ $parse_pos and consuming as much of the input value as possible.
3939
<term><parameter>formatter</parameter></term>
4040
<listitem>
4141
<para>
42-
The formatter resource
42+
The formatter resource
4343
</para>
4444
</listitem>
4545
</varlistentry>
4646
<varlistentry>
4747
<term><parameter>string</parameter></term>
4848
<listitem>
4949
<para>
50-
string to convert to a time
50+
string to convert to a time
5151
</para>
5252
</listitem>
5353
</varlistentry>
@@ -58,14 +58,14 @@ $parse_pos and consuming as much of the input value as possible.
5858
Position at which to start the parsing in $value (zero-based).
5959
If no error occurs before $value is consumed, $parse_pos will contain -1
6060
otherwise it will contain the position at which parsing ended .
61-
If $parse_pos &gt; strlen($value), the parse fails immediately.
61+
If $parse_pos &gt; strlen($value), the parse fails immediately.
6262
</para>
6363
</listitem>
6464
</varlistentry>
6565
</variablelist>
6666
</para>
6767
</refsect1>
68-
68+
6969

7070
<refsect1 role="returnvalues">
7171
&reftitle.returnvalues;
@@ -90,7 +90,7 @@ $fmt = datefmt_create(
9090
'America/Los_Angeles',
9191
IntlDateFormatter::GREGORIAN
9292
);
93-
$arr = datefmt_localtime($fmt, 'Wednesday, December 31, 1969 4:00:00 PM PT', 0);
93+
$arr = datefmt_localtime($fmt, 'Wednesday, December 31, 1969 at 4:00:00 PM Pacific Standard Time', $offset);
9494
echo 'First parsed output is ';
9595
if ($arr) {
9696
foreach ($arr as $key => $value) {
@@ -114,7 +114,7 @@ $fmt = new IntlDateFormatter(
114114
'America/Los_Angeles',
115115
IntlDateFormatter::GREGORIAN
116116
);
117-
$arr = $fmt->localtime('Wednesday, December 31, 1969 4:00:00 PM PT', 0);
117+
$arr = $fmt->localtime('Wednesday, December 31, 1969 at 4:00:00 PM Pacific Standard Time', $offset);
118118
echo 'First parsed output is ';
119119
if ($arr) {
120120
foreach ($arr as $key => $value) {
@@ -129,8 +129,8 @@ if ($arr) {
129129
&example.outputs;
130130
<screen>
131131
<![CDATA[
132-
First parsed output is tm_sec : 0 , tm_min : 0 , tm_hour : 16 , tm_year : 1969 ,
133-
tm_mday : 31 , tm_wday : 4 , tm_yday : 365 , tm_mon : 11 , tm_isdst : 0 ,
132+
First parsed output is tm_sec : 0 , tm_min : 0 , tm_hour : 16 , tm_year : 69 ,
133+
tm_mday : 31 , tm_wday : 3 , tm_yday : 365 , tm_mon : 11 , tm_isdst : 0 ,
134134
]]>
135135
</screen>
136136
</refsect1>

0 commit comments

Comments
 (0)