diff options
author | Derick Rethans <derick@php.net> | 2011-12-07 19:24:58 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2011-12-07 19:24:58 +0000 |
commit | 60d195dc4473d1bae1884af5d4cd6a12674d70f8 (patch) | |
tree | acbabc5935ae5a2d5683c60e86a268498b172009 | |
parent | bc8fc80049e1cd9c57c2b82f42100f880e80212b (diff) | |
download | php-git-60d195dc4473d1bae1884af5d4cd6a12674d70f8.tar.gz |
Sorting out the tests *once* more.
Please keep them consistent and only change them if you are 110% certain what
you're doing. Otherwise -> please ask.
-rw-r--r-- | ext/date/tests/bug28088.phpt | 4 | ||||
-rw-r--r-- | ext/date/tests/bug33415-2.phpt | 144 | ||||
-rw-r--r-- | ext/date/tests/bug52062-64bit.phpt | 27 | ||||
-rw-r--r-- | ext/date/tests/bug52062.phpt | 8 | ||||
-rw-r--r-- | ext/date/tests/bug52113.phpt (renamed from ext/date/tests/bug51223.phpt) | 2 | ||||
-rw-r--r-- | ext/date/tests/bug53502.phpt | 2 | ||||
-rw-r--r-- | ext/date/tests/gmstrftime_variation22.phpt | 13 | ||||
-rw-r--r-- | ext/date/tests/strftime_variation22.phpt | 13 |
8 files changed, 78 insertions, 135 deletions
diff --git a/ext/date/tests/bug28088.phpt b/ext/date/tests/bug28088.phpt index 95866e00be..c310139383 100644 --- a/ext/date/tests/bug28088.phpt +++ b/ext/date/tests/bug28088.phpt @@ -1,9 +1,9 @@ --TEST-- Bug #28088 (strtotime() cannot convert 00 hours") +--INI-- +date.timezone=UTC --FILE-- <?php -putenv("TZ=GMT"); - echo "The following line rightly shows the correct date time:\n"; echo gmdate("m/d/y Hi", strtotime("04/04/04 2345")), "\n"; diff --git a/ext/date/tests/bug33415-2.phpt b/ext/date/tests/bug33415-2.phpt index 50fface88b..424be76fc4 100644 --- a/ext/date/tests/bug33415-2.phpt +++ b/ext/date/tests/bug33415-2.phpt @@ -2,14 +2,10 @@ Bug #33415 [2] (Possibly invalid non-one-hour DST or timezone shifts) --FILE-- <?php +date_default_timezone_set('Africa/Bujumbura'); print "TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to have a DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Africa/Bujumbura'); -} else { - putenv("TZ=Africa/Bujumbura"); -} $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Wednesday", $tStamp); @@ -17,11 +13,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Wednesday 00:00:00\n\n"; print "TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Asia/Thimbu'); -} else { - putenv("TZ=Asia/Thimbu"); -} +date_default_timezone_set('Asia/Thimbu'); $tStamp = mktime (17, 17, 17, 1, 6476, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -30,11 +22,7 @@ print "wanted=Thursday 00:30:00\n\n"; print "TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not appear to have a DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Indian/Cocos'); -} else { - putenv("TZ=Indian/Cocos"); -} +date_default_timezone_set('Indian/Cocos'); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -43,11 +31,7 @@ print "wanted=Thursday 00:00:00\n\n"; print "TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does not appear to have a DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Africa/Lubumbashi'); -} else { - putenv("TZ=Africa/Lubumbashi"); -} +date_default_timezone_set('Africa/Lubumbashi'); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Saturday", $tStamp); @@ -55,11 +39,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Saturday 00:00:00\n\n"; print "TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Asia/Kashgar'); -} else { - putenv("TZ=Asia/Kashgar"); -} +date_default_timezone_set('Asia/Kashgar'); $tStamp = mktime (17, 17, 17, 1, 3767, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -68,11 +48,7 @@ print "wanted=Thursday 03:00:00\n\n"; print "TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does not appear to have a DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Indian/Christmas'); -} else { - putenv("TZ=Indian/Christmas"); -} +date_default_timezone_set('Indian/Christmas'); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Sunday", $tStamp); @@ -80,11 +56,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Sunday 00:00:00\n\n"; print "TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('America/Santo_Domingo'); -} else { - putenv("TZ=America/Santo_Domingo"); -} +date_default_timezone_set('America/Santo_Domingo'); $tStamp = mktime (17, 17, 17, 1, 291, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Sunday", $tStamp); @@ -93,11 +65,7 @@ print "wanted=Sunday 00:30:00\n\n"; print "TZ=Pacific/Truk - Is it OK for this to be 10 AM? Note: does not appear to have a DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Pacific/Truk'); -} else { - putenv("TZ=Pacific/Truk"); -} +date_default_timezone_set('Pacific/Truk'); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Tuesday", $tStamp); @@ -106,11 +74,7 @@ print "wanted=Tuesday 00:00:00\n\n"; print "TZ=Pacific/Ponape - Is it OK for this to be 11 AM? Note: does not appear to have a DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Pacific/Ponape'); -} else { - putenv("TZ=Pacific/Ponape"); -} +date_default_timezone_set('Pacific/Ponape'); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Monday", $tStamp); @@ -118,11 +82,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Monday 00:00:00\n\n"; print "TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('America/Scoresbysund'); -} else { - putenv("TZ=America/Scoresbysund"); -} +date_default_timezone_set('America/Scoresbysund'); $tStamp = mktime (17, 17, 17, 1, 4099, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Sunday", $tStamp); @@ -130,11 +90,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Sunday 02:00:00\n\n"; print "TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('America/Guyana'); -} else { - putenv("TZ=America/Guyana"); -} +date_default_timezone_set('America/Guyana'); $tStamp = mktime (17, 17, 17, 1, 2031, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -142,11 +98,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Thursday 00:45:00\n\n"; print "TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Asia/Tehran'); -} else { - putenv("TZ=Asia/Tehran"); -} +date_default_timezone_set('Asia/Tehran'); $tStamp = mktime (17, 17, 17, 1, 2855, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Tuesday", $tStamp); @@ -155,11 +107,7 @@ print "wanted=Tuesday 00:30:00\n\n"; print "TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does not appear to have a DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Pacific/Tarawa'); -} else { - putenv("TZ=Pacific/Tarawa"); -} +date_default_timezone_set('Pacific/Tarawa'); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Monday", $tStamp); @@ -167,11 +115,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Monday 00:00:00\n\n"; print "TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Africa/Monrovia'); -} else { - putenv("TZ=Africa/Monrovia"); -} +date_default_timezone_set('Africa/Monrovia'); $tStamp = mktime (17, 17, 17, 1, 845, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Monday", $tStamp); @@ -179,11 +123,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Monday 00:44:30\n\n"; print "TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Asia/Katmandu'); -} else { - putenv("TZ=Asia/Katmandu"); -} +date_default_timezone_set('Asia/Katmandu'); $tStamp = mktime (17, 17, 17, 1, 5838, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Wednesday", $tStamp); @@ -191,11 +131,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Wednesday 00:15:00\n\n"; print "TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Pacific/Nauru'); -} else { - putenv("TZ=Pacific/Nauru"); -} +date_default_timezone_set('Pacific/Nauru'); $tStamp = mktime (17, 17, 17, 1, 3401, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Tuesday", $tStamp); @@ -203,11 +139,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Tuesday 00:30:00\n\n"; print "TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Pacific/Niue'); -} else { - putenv("TZ=Pacific/Niue"); -} +date_default_timezone_set('Pacific/Niue'); $tStamp = mktime (17, 17, 17, 1, 3189, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Sunday", $tStamp); @@ -216,11 +148,7 @@ print "wanted=Sunday 00:30:00\n\n"; print "TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Pacific/Port_Moresby'); -} else { - putenv("TZ=Pacific/Port_Moresby"); -} +date_default_timezone_set('Pacific/Port_Moresby'); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -228,11 +156,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Thursday 00:00:00\n\n"; print "TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('America/Miquelon'); -} else { - putenv("TZ=America/Miquelon"); -} +date_default_timezone_set('America/Miquelon'); $tStamp = mktime (17, 17, 17, 1, 3767, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Thursday", $tStamp); @@ -241,11 +165,7 @@ print "wanted=Thursday 01:00:00\n\n"; print "TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Pacific/Palau'); -} else { - putenv("TZ=Pacific/Palau"); -} +date_default_timezone_set('Pacific/Palau'); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Saturday", $tStamp); @@ -254,11 +174,7 @@ print "wanted=Saturday 00:00:00\n\n"; print "TZ=Pacific/Funafuti - Is it OK for this to be midday? Note: does not appear to have a DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Pacific/Funafuti'); -} else { - putenv("TZ=Pacific/Funafuti"); -} +date_default_timezone_set('Pacific/Funafuti'); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Wednesday", $tStamp); @@ -267,11 +183,7 @@ print "wanted=Wednesday 00:00:00\n\n"; print "TZ=Pacific/Wake - Is it OK for this to be midday? Note: does not appear to have a DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Pacific/Wake'); -} else { - putenv("TZ=Pacific/Wake"); -} +date_default_timezone_set('Pacific/Wake'); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Tuesday", $tStamp); @@ -280,11 +192,7 @@ print "wanted=Tuesday 00:00:00\n\n"; print "TZ=Pacific/Wallis - Is it OK for this to be midday? Note: does not appear to have a DST or timezone transition.\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('Pacific/Wallis'); -} else { - putenv("TZ=Pacific/Wallis"); -} +date_default_timezone_set('Pacific/Wallis'); $tStamp = mktime (17, 17, 17, 1, 1, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Tuesday", $tStamp); @@ -292,11 +200,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n"; print "wanted=Tuesday 00:00:00\n\n"; print "TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes\n"; -if (defined('PHP_WINDOWS_VERSION_MAJOR')) { - date_default_timezone_set('America/Paramaribo'); -} else { - putenv("TZ=America/Paramaribo"); -} +date_default_timezone_set('America/Paramaribo'); $tStamp = mktime (17, 17, 17, 1, 5381, 1970); print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n"; $strtotime_tstamp = strtotime("next Monday", $tStamp); diff --git a/ext/date/tests/bug52062-64bit.phpt b/ext/date/tests/bug52062-64bit.phpt new file mode 100644 index 0000000000..861e578dd2 --- /dev/null +++ b/ext/date/tests/bug52062-64bit.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp (64 bit) +--SKIPIF-- +<?php +if (PHP_INT_SIZE == 4) die('skip 64 bit only'); +?> +--INI-- +date.timezone=UTC +--FILE-- +<?php +$d = new DateTime('@100000000000'); +var_dump($d->format('Y-m-d H:i:s U')); +var_dump($d->getTimestamp()); + +$d->setTimestamp(100000000000); +var_dump($d->format('Y-m-d H:i:s U')); +var_dump($d->getTimestamp()); + +$i = new DateInterval('PT100000000000S'); +var_dump($i->format('%s')); +?> +--EXPECT-- +string(32) "5138-11-16 09:46:40 100000000000" +int(100000000000) +string(32) "5138-11-16 09:46:40 100000000000" +int(100000000000) +string(12) "100000000000" diff --git a/ext/date/tests/bug52062.phpt b/ext/date/tests/bug52062.phpt index ae8fbc381d..c992a2847f 100644 --- a/ext/date/tests/bug52062.phpt +++ b/ext/date/tests/bug52062.phpt @@ -1,5 +1,11 @@ --TEST-- -Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp +Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp (32 bit) +--SKIPIF-- +<?php +if (PHP_INT_SIZE == 8) die('skip 32-bit only'); +?> +--INI-- +date.timezone=UTC --FILE-- <?php $d = new DateTime('@100000000000'); diff --git a/ext/date/tests/bug51223.phpt b/ext/date/tests/bug52113.phpt index cb91d1d99b..8d8569b0af 100644 --- a/ext/date/tests/bug51223.phpt +++ b/ext/date/tests/bug52113.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #52113: Seg fault while creating (by unserialization) DatePeriod +--INI-- +date.timezone=UTC --FILE-- <?php $start = new DateTime('2003-01-02 08:00:00'); diff --git a/ext/date/tests/bug53502.phpt b/ext/date/tests/bug53502.phpt index 6c17078090..87b648e354 100644 --- a/ext/date/tests/bug53502.phpt +++ b/ext/date/tests/bug53502.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #53502: strtotime with timezone memory leak +--INI-- +date.timezone=UTC --FILE-- <?php for ($i = 0; $i < 1000; $i++) { diff --git a/ext/date/tests/gmstrftime_variation22.phpt b/ext/date/tests/gmstrftime_variation22.phpt index 198941871c..d9abdce17a 100644 --- a/ext/date/tests/gmstrftime_variation22.phpt +++ b/ext/date/tests/gmstrftime_variation22.phpt @@ -5,8 +5,8 @@ Test gmstrftime() function : usage variation - Checking Preferred date and time if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { die("skip Test is not valid for Windows"); } -if (!setlocale(LC_ALL, "en_US.utf8", "en_US")) { - die("skip Locale en_US or en_US.utf8 is required to run this test"); +if (!setlocale(LC_TIME, "POSIX")) { + die("skip Locale POSIX is required to run this test"); } ?> --FILE-- @@ -21,7 +21,8 @@ echo "*** Testing gmstrftime() : usage variation ***\n"; // Initialise function arguments not being substituted (if any) $timestamp = gmmktime(8, 8, 8, 8, 8, 2008); -setlocale(LC_ALL, "en_US.utf8", "en_US"); +setlocale(LC_TIME, "POSIX"); +putenv("LC_TIME=POSIX"); date_default_timezone_set("Asia/Calcutta"); //array of values to iterate over @@ -46,13 +47,13 @@ foreach($inputs as $key =>$value) { --Preferred date and time representation-- string(2) "%c" -string(31) "Fri 08 Aug 2008 08:08:08 AM GMT" +string(24) "Fri Aug 8 08:08:08 2008" --Preferred date representation-- string(2) "%x" -string(10) "08/08/2008" +string(8) "08/08/08" --Preferred time representation-- string(2) "%X" -string(11) "08:08:08 AM" +string(8) "08:08:08" ===DONE=== diff --git a/ext/date/tests/strftime_variation22.phpt b/ext/date/tests/strftime_variation22.phpt index 151a7d2067..7b72ca51e1 100644 --- a/ext/date/tests/strftime_variation22.phpt +++ b/ext/date/tests/strftime_variation22.phpt @@ -5,8 +5,8 @@ Test strftime() function : usage variation - Checking Preferred date and time re if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { die("skip Test is not valid for Windows"); } -if(!setlocale(LC_ALL, "en_US.utf8", "en_US")) { - die("skip Locale en_US.utf8 or en_US is needed by test and is not available"); +if(!setlocale(LC_ALL, "POSIX")) { + die("skip Locale POSIX is needed by test and is not available"); } ?> --FILE-- @@ -20,7 +20,8 @@ if(!setlocale(LC_ALL, "en_US.utf8", "en_US")) { echo "*** Testing strftime() : usage variation ***\n"; // Initialise function arguments not being substituted (if any) -setlocale(LC_ALL, "en_US.utf8", "en_US"); +setlocale(LC_ALL, "POSIX"); +putenv("LC_ALL=POSIX"); date_default_timezone_set("Asia/Calcutta"); $timestamp = mktime(8, 8, 8, 8, 8, 2008); @@ -46,13 +47,13 @@ foreach($inputs as $key =>$value) { --Preferred date and time representation-- string(2) "%c" -string(31) "Fri 08 Aug 2008 08:08:08 AM IST" +string(24) "Fri Aug 8 08:08:08 2008" --Preferred date representation-- string(2) "%x" -string(10) "08/08/2008" +string(8) "08/08/08" --Preferred time representation-- string(2) "%X" -string(11) "08:08:08 AM" +string(8) "08:08:08" ===DONE=== |