#37317 [Bgs]: mktime problem

From: Date: Thu, 04 May 2006 23:48:23 +0000
Subject: #37317 [Bgs]: mktime problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-96627@lists.php.net to get a copy of this message
ID: 37317 User updated by: ramsessivira at yahoo dot com Reported By: ramsessivira at yahoo dot com Status: Bogus Bug Type: Date/time related Operating System: windows xp PHP Version: 5.1.3 New Comment: What can i do to fix the problem? I am trying to calculate the age being started off of the birthday Previous Comments: ------------------------------------------------------------------------ [2006-05-04 23:22:54] tony2001@php.net Yes, because in 2038 integer overflow is going to happen. ------------------------------------------------------------------------ [2006-05-04 23:20:07] ramsessivira at yahoo dot com Description: ------------ For years up to 2038 the mktime instruction does not give back any result Reproduce code: --------------- for($x=2037;$x<2041;$x++){ echo mktime(0,0,0,1,1,$x)." Date: ".date( "M-d-Y",mktime(0,0,0,1,1,$x))."<br>"; } Expected result: ---------------- 2114395200 Date: Jan-01-2037 2145931200 Date: Jan-01-2038 some value Date: Jan-01-2039 some value Date: Jan-01-2040 Actual result: -------------- 2114395200 Date: Jan-01-2037 2145931200 Date: Jan-01-2038 Date: Dec-31-1969 Date: Dec-31-1969 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37317&edit=1

« previous php.bugs (#96627) next »