note 47183 added to function.mktime

From: Date: Fri, 05 Nov 2004 12:02:49 +0000
Subject: note 47183 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-80142@lists.php.net to get a copy of this message
@Evorg, expiration date in "the past" By using mktime(1,0,0,1, 1, 1990) to get a timestamp that's "in the past" you're only almost there: You could use mktime(1,0,0,1, 1, 1970) which is even more "in the past". And this returns the timestamp 0 (zero) because it's defined as the starting point of timestamp counting (Thu 1970-01-01 01:00:00). So you can (and should) dump the unnecessary function call and directly define the "expired in the past"-timestamp as 0. BTW: You should't go beyond that (i.e. negative timestamp values) because not all systems support that. ---- Manual Page -- http://www.php.net/manual/en/function.mktime.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47183 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47183&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47183&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47183&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47183&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47183&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47183&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47183&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80142) next »