mirror of
https://github.com/php/php-src.git
synced 2025-01-10 04:54:47 +08:00
81cfb1b312
# FreeBSD mktime() returns -1 if is_dst==1 and no DST timezone is set
50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
--TEST--
|
|
mktime()
|
|
--FILE--
|
|
<?php /* $Id$ */
|
|
$timezones = array(
|
|
'GMT0',
|
|
'Europe/London'
|
|
);
|
|
|
|
foreach($timezones as $timezone)
|
|
{
|
|
putenv('TZ='.$timezone);
|
|
|
|
/* status of daylight saving time unknown */
|
|
var_dump(mktime(0, 0, 0, 1, 1, 2002));
|
|
/* status of daylight saving time unknown */
|
|
var_dump(mktime(0, 0, 0, 1, 1, 2002, -1));
|
|
/* daylight saving time is not in effect */
|
|
var_dump(mktime(0, 0, 0, 1, 1, 2002, 0));
|
|
/* daylight saving time is in effect */
|
|
var_dump(mktime(0, 0, 0, 1, 1, 2002, 1));
|
|
|
|
/* status of daylight saving time unknown */
|
|
var_dump(mktime(0, 0, 0, 7, 1, 2002));
|
|
/* status of daylight saving time unknown */
|
|
var_dump(mktime(0, 0, 0, 7, 1, 2002, -1));
|
|
/* daylight saving time is not in effect */
|
|
var_dump(mktime(0, 0, 0, 7, 1, 2002, 0));
|
|
/* daylight saving time is in effect */
|
|
var_dump(mktime(0, 0, 0, 7, 1, 2002, 1));
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
int(1009843200)
|
|
int(1009843200)
|
|
int(1009843200)
|
|
int(%s)
|
|
int(1025481600)
|
|
int(1025481600)
|
|
int(1025481600)
|
|
int(%s)
|
|
int(1009843200)
|
|
int(1009843200)
|
|
int(1009843200)
|
|
int(1009839600)
|
|
int(1025478000)
|
|
int(1025478000)
|
|
int(1025481600)
|
|
int(1025478000)
|