note 66928 rejected from function.gmmktime by nlopess

From: Date: Thu, 01 Jun 2006 08:50:26 +0000
Subject: note 66928 rejected from function.gmmktime by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-112726@lists.php.net to get a copy of this message
Note Submitter: fredrik dot stark at gmail dot com ---- For some reasing mktime() refuses to convert timestamps prior to 1969-12-31 20:58:58 (!). Or have i lost my head? If i had it running on a windows box it would make sense, but its linux (2.4.21) PHP Version 4.3.10 Apache/1.3.33 This is the code (that works fine on my php5/debian/same apache-machine: http://leetclocks.com/timestamp_bug.php) <? $timestamp = mktime(0,0,0,5,3,1951); $newstamp = mktime(0, 0, 0, date('m',$timestamp), date('d',$timestamp), date('Y',$timestamp)); echo '<p>Now: '.date('U').' ('.date('Y-m-d G:i:s').')</p>'; echo '<p>1951-05-03: '.$newstamp.' ('.date("Y-m-d G:i:s", $newstamp).')</p>'; echo '<p>'.date("Y-m-d G:i:s", -99999999999).'</p>'; ?> The result: http://altnet.se/timestamp_bug.php

« previous php.notes (#112726) next »