-
Notifications
You must be signed in to change notification settings - Fork 202
/
Copy pathtimezones.phpt
44 lines (41 loc) · 1.09 KB
/
timezones.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--TEST--
Test V8::executeString() : Check timezone handling
--SKIPIF--
<?php
if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
die('SKIP TZ not handled by v8 on Windows');
}
require_once(dirname(__FILE__) . '/skipif.inc');
?>
--FILE--
<?php
putenv('LC_ALL=C');
$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 (Eastern European Standard Time)
Thu Mar 20 2014 05:03:24 GMT-0400 (Eastern Daylight Time)
Thu Mar 20 2014 11:03:24 GMT+0200 (Eastern European Standard Time)
===EOF===