mirror of
https://github.com/phpv8/v8js.git
synced 2024-11-08 12:38:41 +00:00
0a85d27ee7
Also added a test.
39 lines
929 B
PHP
39 lines
929 B
PHP
--TEST--
|
|
Test V8::executeString() : Check timezone handling
|
|
--SKIPIF--
|
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$v8 = new V8Js();
|
|
try {
|
|
putenv('TZ=Europe/Helsinki');
|
|
$v8->executeString('print (new Date("Thu, 20 Mar 2014 09:03:24 +0000")).toString();');
|
|
echo "\n";
|
|
} catch (V8JsScriptException $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
|
|
try {
|
|
putenv('TZ=America/New_York');
|
|
$v8->executeString('print (new Date("Thu, 20 Mar 2014 09:03:24 +0000")).toString();');
|
|
echo "\n";
|
|
} catch (V8JsScriptException $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
|
|
try {
|
|
putenv('TZ=Europe/Helsinki');
|
|
$v8->executeString('print (new Date("Thu, 20 Mar 2014 09:03:24 +0000")).toString();');
|
|
echo "\n";
|
|
} catch (V8JsScriptException $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
?>
|
|
===EOF===
|
|
--EXPECT--
|
|
Thu Mar 20 2014 11:03:24 GMT+0200 (EET)
|
|
Thu Mar 20 2014 05:03:24 GMT-0400 (EDT)
|
|
Thu Mar 20 2014 11:03:24 GMT+0200 (EET)
|
|
===EOF===
|