mirror of
https://github.com/php/php-src.git
synced 2024-11-30 21:35:36 +08:00
- Now as text and not HTML.
This commit is contained in:
parent
8d31d2e896
commit
f33cfbabfe
@ -1,3 +1,9 @@
|
||||
<code><span style="color: #000000">
|
||||
--TEST--<br />Bug #37616 (DATE_RFC822 does not product RFC 822 dates)<br />--FILE--<br /><span style="color: #0000BB"><?php<br /> date_default_timezone_set</span><span style="color: #007700">(</span><span style="color: #DD0000">"Europe/Oslo"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #0000BB">DATE_RFC822</span><span style="color: #007700">, </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1 Jul 06 14:27:30 +0200"</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB">?><br /></span>--EXPECT--<br />string(29) "Sat, 01 Jul 06 14:27:30 +0200"<br /></span>
|
||||
</code>
|
||||
--TEST--
|
||||
Bug #37616 (DATE_RFC822 does not product RFC 822 dates)
|
||||
--FILE--
|
||||
<?php
|
||||
date_default_timezone_set("Europe/Oslo");
|
||||
var_dump(date(DATE_RFC822, strtotime("1 Jul 06 14:27:30 +0200")));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(29) "Sat, 01 Jul 06 14:27:30 +0200"
|
||||
|
@ -1,3 +1,44 @@
|
||||
<code><span style="color: #000000">
|
||||
--TEST--<br />Date constants<br />--FILE--<br /><span style="color: #0000BB"><?php<br /> date_default_timezone_set</span><span style="color: #007700">(</span><span style="color: #DD0000">"Europe/Oslo"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$constants </span><span style="color: #007700">= array(<br /> </span><span style="color: #0000BB">DATE_ATOM</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_COOKIE</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_ISO8601</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_RFC822</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_RFC850</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_RFC1036</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_RFC1123</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_RFC2822</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_RSS</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_W3C<br /> </span><span style="color: #007700">);<br /> <br /> foreach(</span><span style="color: #0000BB">$constants </span><span style="color: #007700">as </span><span style="color: #0000BB">$const</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #0000BB">$const</span><span style="color: #007700">, </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1 Jul 06 14:27:30 +0200"</span><span style="color: #007700">)));<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #0000BB">$const</span><span style="color: #007700">, </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"2006-05-30T14:32:13+02:00"</span><span style="color: #007700">)));<br /> }<br /></span><span style="color: #0000BB">?><br /></span>--EXPECT--<br />string(25) "2006-07-01T14:27:30+02:00"<br />string(25) "2006-05-30T14:32:13+02:00"<br />string(31) "Sat, 01 Jul 2006 14:27:30 +0200"<br />string(31) "Tue, 30 May 2006 14:32:13 +0200"<br />string(24) "2006-07-01T14:27:30+0200"<br />string(24) "2006-05-30T14:32:13+0200"<br />string(29) "Sat, 01 Jul 06 14:27:30 +0200"<br />string(29) "Tue, 30 May 06 14:32:13 +0200"<br />string(33) "Saturday, 01-Jul-06 14:27:30 CEST"<br />string(32) "Tuesday, 30-May-06 14:32:13 CEST"<br />string(29) "Sat, 01 Jul 06 14:27:30 +0200"<br />string(29) "Tue, 30 May 06 14:32:13 +0200"<br />string(31) "Sat, 01 Jul 2006 14:27:30 +0200"<br />string(31) "Tue, 30 May 2006 14:32:13 +0200"<br />string(31) "Sat, 01 Jul 2006 14:27:30 +0200"<br />string(31) "Tue, 30 May 2006 14:32:13 +0200"<br />string(31) "Sat, 01 Jul 2006 14:27:30 +0200"<br />string(31) "Tue, 30 May 2006 14:32:13 +0200"<br />string(25) "2006-07-01T14:27:30+02:00"<br />string(25) "2006-05-30T14:32:13+02:00"<br /></span>
|
||||
</code>
|
||||
--TEST--
|
||||
Date constants
|
||||
--FILE--
|
||||
<?php
|
||||
date_default_timezone_set("Europe/Oslo");
|
||||
$constants = array(
|
||||
DATE_ATOM,
|
||||
DATE_COOKIE,
|
||||
DATE_ISO8601,
|
||||
DATE_RFC822,
|
||||
DATE_RFC850,
|
||||
DATE_RFC1036,
|
||||
DATE_RFC1123,
|
||||
DATE_RFC2822,
|
||||
DATE_RSS,
|
||||
DATE_W3C
|
||||
);
|
||||
|
||||
foreach($constants as $const) {
|
||||
var_dump(date($const, strtotime("1 Jul 06 14:27:30 +0200")));
|
||||
var_dump(date($const, strtotime("2006-05-30T14:32:13+02:00")));
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(25) "2006-07-01T14:27:30+02:00"
|
||||
string(25) "2006-05-30T14:32:13+02:00"
|
||||
string(31) "Sat, 01 Jul 2006 14:27:30 +0200"
|
||||
string(31) "Tue, 30 May 2006 14:32:13 +0200"
|
||||
string(24) "2006-07-01T14:27:30+0200"
|
||||
string(24) "2006-05-30T14:32:13+0200"
|
||||
string(29) "Sat, 01 Jul 06 14:27:30 +0200"
|
||||
string(29) "Tue, 30 May 06 14:32:13 +0200"
|
||||
string(33) "Saturday, 01-Jul-06 14:27:30 CEST"
|
||||
string(32) "Tuesday, 30-May-06 14:32:13 CEST"
|
||||
string(29) "Sat, 01 Jul 06 14:27:30 +0200"
|
||||
string(29) "Tue, 30 May 06 14:32:13 +0200"
|
||||
string(31) "Sat, 01 Jul 2006 14:27:30 +0200"
|
||||
string(31) "Tue, 30 May 2006 14:32:13 +0200"
|
||||
string(31) "Sat, 01 Jul 2006 14:27:30 +0200"
|
||||
string(31) "Tue, 30 May 2006 14:32:13 +0200"
|
||||
string(31) "Sat, 01 Jul 2006 14:27:30 +0200"
|
||||
string(31) "Tue, 30 May 2006 14:32:13 +0200"
|
||||
string(25) "2006-07-01T14:27:30+02:00"
|
||||
string(25) "2006-05-30T14:32:13+02:00"
|
||||
|
Loading…
Reference in New Issue
Block a user