ID: 22198 Comment by: jim dot hatfield at insignia dot com Reported By: jm at sindigit dot pt Status: Analyzed Bug Type: Documentation problem Operating System: Solaris 8 (sparc) PHP Version: 4.3.0 New Comment:
Ditto on FreeBSD 4.7: echo mktime(0, 0, 0, 3, 29, 2003) . "\n"; echo mktime(0, 0, 0, 3, 30, 2003) . "\n"; echo mktime(0, 0, 0, 3, 31, 2003) . "\n"; gives: 1048896000 -3662 1049065200 This from a machine in the UK, where we switched to DST on the date in question. Previous Comments: ------------------------------------------------------------------------ [2003-02-21 10:26:47] say_ten at multiplay dot co dot uk I have a very similar problem to this but with much more severe symptoms. sol# php -v PHP 4.3.0 (cli) (built: Feb 1 2003 23:36:25) Copyright (c) 1997-2002 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies sol# uname -sr FreeBSD 4.7-STABLE sol# php -q data.php 1048896000 29/03/2003 -3662 31/12/1969 ------------------------------------------------------------------------ [2003-02-13 16:51:35] jm at sindigit dot pt $ zdump -v "Europe/Lisbon" | grep 2003 Europe/Lisbon Sun Mar 30 00:59:59 2003 UTC = Sun Mar 30 00:59:59 2003 WET isdst =0 gmtoff=0 Europe/Lisbon Sun Mar 30 01:00:00 2003 UTC = Sun Mar 30 02:00:00 2003 WEST isds t=1 gmtoff=3600 Europe/Lisbon Sun Oct 26 00:59:59 2003 UTC = Sun Oct 26 01:59:59 2003 WEST isds t=1 gmtoff=3600 Europe/Lisbon Sun Oct 26 01:00:00 2003 UTC = Sun Oct 26 01:00:00 2003 WET isdst =0 gmtoff=0 $ ------------------------------------------------------------------------ [2003-02-13 14:43:22] michael dot mauch at gmx dot de Out of curiosity: can you please check the TZ environment variable on your machines and perhaps also the output of zdump -v "$TZ" | grep 2003 On Linux, I get: # zdump -v "Europe/Lisbon" | grep 2003 Europe/Lisbon Sun Mar 30 00:59:59 2003 UTC = Sun Mar 30 00:59:59 2003 WET isdst=0 gmtoff=0 Europe/Lisbon Sun Mar 30 01:00:00 2003 UTC = Sun Mar 30 02:00:00 2003 WEST isdst=1 gmtoff=3600 Europe/Lisbon Sun Oct 26 00:59:59 2003 UTC = Sun Oct 26 01:59:59 2003 WEST isdst=1 gmtoff=3600 Europe/Lisbon Sun Oct 26 01:00:00 2003 UTC = Sun Oct 26 01:00:00 2003 WET isdst=0 gmtoff=0 ------------------------------------------------------------------------ [2003-02-12 22:22:17] jm at sindigit dot pt Setting is_dst to 0 *solves* it for solaris. Curiously though, it totally brakes for freebsd between 1-2AM. setting is_dst (either with the default -1 or with 0 or 1) in freebsd outputs: ... (0 h, 59 m, 58 s) 1048985998 --> 30/03/2003 (0 h, 59 m, 59 s) 1048985999 --> 30/03/2003 (1 h, 0 m, 0 s) -1 --> 01/01/1970 (1 h, 0 m, 1 s) -1 --> 01/01/1970 ... (1 h, 59 m, 58 s) -1 --> 01/01/1970 (1 h, 59 m, 59 s) -1 --> 01/01/1970 (2 h, 0 m, 0 s) 1048986000 --> 30/03/2003 (2 h, 0 m, 1 s) 1048986001 --> 30/03/2003 ... ------------------------------------------------------------------------ [2003-02-12 21:56:14] [EMAIL PROTECTED] btw. mktime() has 7th optional parameter 'is_dst'. When I use your example script, and set that to 1, I get same results as you. >From manual page for mktime: "is_dst can be set to 1 if the time is during daylight savings time, 0 if it is not, or -1 (the default) if it is unknown whether the time is within daylight savings time or not. If it's unknown, PHP tries to figure it out itself. This can cause unexpected (but not incorrect) results. " Try setting that to 0. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/22198 -- Edit this bug report at http://bugs.php.net/?id=22198&edit=1 -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php