reference/datetime/dateinterval/format.xml
02ff7fef5b34cf8f5395180d9d39fb64d9398d00
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="dateinterval.format" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>DateInterval::format</refname>
...
...
@@ -9,7 +8,7 @@
9
8

10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
-
<methodsynopsis role="oop">
11
+
<methodsynopsis role="DateInterval">
13
12
<modifier>public</modifier> <type>string</type><methodname>DateInterval::format</methodname>
14
13
<methodparam><type>string</type><parameter>format</parameter></methodparam>
15
14
</methodsynopsis>
...
...
@@ -113,6 +112,17 @@
113
112
<entry><literal>1</literal>, <literal>3</literal>, <literal>57</literal></entry>
114
113
</row>
115
114
<row>
115
+
<entry><literal>F</literal></entry>
116
+
<entry>Microseconds, numeric, at least 6 digits with leading
117
+
0</entry>
118
+
<entry><literal>007701</literal>, <literal>052738</literal>, <literal>428291</literal></entry>
119
+
</row>
120
+
<row>
121
+
<entry><literal>f</literal></entry>
122
+
<entry>Microseconds, numeric</entry>
123
+
<entry><literal>7701</literal>, <literal>52738</literal>, <literal>428291</literal></entry>
124
+
</row>
125
+
<row>
116
126
<entry><literal>R</literal></entry>
117
127
<entry>Sign "<literal>-</literal>" when negative, "<literal>+</literal>" when positive</entry>
118
128
<entry><literal>-</literal>, <literal>+</literal></entry>
...
...
@@ -120,7 +130,7 @@
120
130
<row>
121
131
<entry><literal>r</literal></entry>
122
132
<entry>Sign "<literal>-</literal>" when negative, empty when positive</entry>
123
-
<entry><literal>-</literal>, <literal></literal></entry>
133
+
<entry><literal>-</literal>, <literal/></entry>
124
134
</row>
125
135
</tbody>
126
136
</tgroup>
...
...
@@ -139,17 +149,32 @@
139
149
</para>
140
150
</refsect1>
141
151

142
-
<refsect1 role="notes">
143
-
&reftitle.notes;
144
-
<note>
145
-
<para>
146
-
The <methodname>DateInterval::format</methodname> method does not
147
-
recalculate carry over points in time strings nor in date segments. This
148
-
is expected because it is not possible to overflow values like <literal>"32 days"</literal>
149
-
which could be interpreted as anything from <literal>"1 month and 4 days"</literal>
150
-
to <literal>"1 month and 1 day"</literal>.
151
-
</para>
152
-
</note>
152
+
<refsect1 role="changelog">
153
+
&reftitle.changelog;
154
+
<para>
155
+
<informaltable>
156
+
<tgroup cols="2">
157
+
<thead>
158
+
<row>
159
+
<entry>&Version;</entry>
160
+
<entry>&Description;</entry>
161
+
</row>
162
+
</thead>
163
+
<tbody>
164
+
<row>
165
+
<entry>7.2.12</entry>
166
+
<entry>The <literal>F</literal> and <literal>f</literal> format
167
+
will now always be positive.</entry>
168
+
</row>
169
+
<row>
170
+
<entry>7.1.0</entry>
171
+
<entry>The <literal>F</literal> and <literal>f</literal> format
172
+
characters were added.</entry>
173
+
</row>
174
+
</tbody>
175
+
</tgroup>
176
+
</informaltable>
177
+
</para>
153
178
</refsect1>
154
179

155
180
<refsect1 role="examples">
...
...
@@ -158,7 +183,7 @@
158
183
<example>
159
184
<title><classname>DateInterval</classname> example</title>
160
185
<programlisting role="php">
161
-
<![CDATA[
186
+
<![CDATA[
162
187
<?php
163
188

164
189
$interval = new DateInterval('P2Y4DT6H8M');
...
...
@@ -169,7 +194,7 @@ echo $interval->format('%d days');
169
194
</programlisting>
170
195
&example.outputs;
171
196
<screen role="php">
172
-
<![CDATA[
197
+
<![CDATA[
173
198
4 days
174
199
]]>
175
200
</screen>
...
...
@@ -179,7 +204,7 @@ echo $interval->format('%d days');
179
204
<example>
180
205
<title><classname>DateInterval</classname> and carry over points</title>
181
206
<programlisting role="php">
182
-
<![CDATA[
207
+
<![CDATA[
183
208
<?php
184
209

185
210
$interval = new DateInterval('P32D');
...
...
@@ -189,8 +214,8 @@ echo $interval->format('%d days');
189
214
]]>
190
215
</programlisting>
191
216
&example.outputs;
192
-
<screen role="php">
193
-
<![CDATA[
217
+
<screen role="php">
218
+
<![CDATA[
194
219
32 days
195
220
]]>
196
221
</screen>
...
...
@@ -203,7 +228,7 @@ echo $interval->format('%d days');
203
228
<methodname>DateTime::diff</methodname> with the %a and %d modifiers
204
229
</title>
205
230
<programlisting role="php">
206
-
<![CDATA[
231
+
<![CDATA[
207
232
<?php
208
233

209
234
$january = new DateTime('2010-01-01');
...
...
@@ -222,7 +247,7 @@ echo $interval->format('%m month, %d days');
222
247
</programlisting>
223
248
&example.outputs;
224
249
<screen role="php">
225
-
<![CDATA[
250
+
<![CDATA[
226
251
31 total days
227
252
1 month, 0 days
228
253
]]>
...
...
@@ -231,6 +256,19 @@ echo $interval->format('%m month, %d days');
231
256
</para>
232
257
</refsect1>
233
258
259
+
<refsect1 role="notes">
260
+
&reftitle.notes;
261
+
<note>
262
+
<para>
263
+
The <methodname>DateInterval::format</methodname> method does not
264
+
recalculate carry over points in time strings nor in date segments. This
265
+
is expected because it is not possible to overflow values like <literal>"32 days"</literal>
266
+
which could be interpreted as anything from <literal>"1 month and 4 days"</literal>
267
+
to <literal>"1 month and 1 day"</literal>.
268
+
</para>
269
+
</note>
270
+
</refsect1>
271
+

234
272
<refsect1 role="seealso">
235
273
&reftitle.seealso;
236
274
<para>
...
...
@@ -241,7 +279,6 @@ echo $interval->format('%m month, %d days');
241
279
</refsect1>
242
280

243
281
</refentry>
244
-

245
282
<!-- Keep this comment at the end of the file
246
283
Local variables:
247
284
mode: sgml
248
285