var_dump(strftime(""));
var_dump(strftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t));
var_dump(strftime("%%q %%a", $t));
-var_dump(strftime("%q", $t));
var_dump(strftime("blah", $t));
var_dump(gmstrftime(""));
var_dump(gmstrftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t));
var_dump(gmstrftime("%%q %%a", $t));
-var_dump(gmstrftime("%q", $t));
var_dump(gmstrftime("blah", $t));
echo "Done\n";
string(%d) "Tue Tuesday Jun June Tue Jun 27 00:00:00 2006 %s
%s %"
string(5) "%q %a"
-string(%d) "%s"
string(4) "blah"
bool(false)
string(%d) "Mon Monday Jun June Mon Jun 26 21:00:00 2006 %s
%s %"
string(5) "%q %a"
-string(%d) "%s"
string(4) "blah"
Done
--TEST--
Bug #27780 (strtotime(+1 xxx) returns a wrong date/time)
---SKIPIF--
-<?php
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
- die("skip. Not the same TZ on windows.");
-}
--FILE--
<?php
$timezones = array (
foreach ($timestrings as $timestring) {
$time = strtotime($timestring);
- echo $time, strftime(" [%Y-%m-%d %H:%M:%S %Z]", $time), " [$timestring]\n";
+ echo $time, date(" [Y-m-d H:i:s T]", $time), " [$timestring]\n";
}
echo "\n";
--TEST--
Bug #32555 (strtotime("tomorrow") can return false)
---SKIPIF--
-<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') die('skip strftime uses system TZ');
-?>
--INI--
date.timezone=US/Eastern
--FILE--
<?php
$stamp = 1112427000;
-print strftime('%c %Z',strtotime('now',$stamp)) ."\n";
-print strftime('%c %Z',strtotime('tomorrow',$stamp)) ."\n";
-print strftime('%c %Z',strtotime('+1 day',$stamp)) ."\n";
-print strftime('%c %Z',strtotime('+2 day',$stamp)) ."\n";
+print date('r', strtotime('now',$stamp)) ."\n";
+print date('r', strtotime('tomorrow',$stamp)) ."\n";
+print date('r', strtotime('+1 day',$stamp)) ."\n";
+print date('r', strtotime('+2 day',$stamp)) ."\n";
?>
--EXPECT--
-Sat Apr 2 02:30:00 2005 EST
-Sun Apr 3 00:00:00 2005 EST
-Sun Apr 3 03:30:00 2005 EDT
-Mon Apr 4 02:30:00 2005 EDT
+Sat, 02 Apr 2005 02:30:00 -0500
+Sun, 03 Apr 2005 00:00:00 -0500
+Sun, 03 Apr 2005 03:30:00 -0400
+Mon, 04 Apr 2005 02:30:00 -0400
--SKIPIF--
<?php
if(PHP_OS == 'Darwin' || defined('PHP_WINDOWS_VERSION_MAJOR')) die("skip strftime uses system TZ on Darwin and Windows");
+if (!strftime('%Z')) die('skip strftime does not support %Z');
?>
--FILE--
<?php
Test strptime() function : basic functionality
--SKIPIF--
<?php
- if (!function_exists('strptime')) {
- die("skip - strptime() function not available in this build");
- }
- if(PHP_OS == 'Darwin') die("skip - strptime() behaves differently on Darwin");
+if (!function_exists('strptime')) {
+ die("skip - strptime() function not available in this build");
+}
+if (PHP_OS == 'Darwin') die("skip - strptime() behaves differently on Darwin");
+if (!strftime('%Z')) die('skip strftime does not support %Z');
?>
--FILE--
<?php
Test strptime() function : basic functionality
--SKIPIF--
<?php
- if (!function_exists('strptime')) {
- die("skip - strptime() function not available in this build");
- }
+if (!function_exists('strptime')) {
+ die("skip - strptime() function not available in this build");
+}
+if (!strftime('%Z')) die('skip strftime does not support %Z');
?>
--FILE--
<?php