#23428 [Opn->Csd]: a Example 3. date() and mktime() example , bug

From: Date: Thu, 01 May 2003 20:18:46 +0000
Subject: #23428 [Opn->Csd]: a Example 3. date() and mktime() example , bug
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969352998@lists.php.net to get a copy of this message
ID: 23428 Updated by: nicos@php.net Reported By: noam at i-com-it dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: redhat 7.2 PHP Version: 4.3.1 New Comment: It's not a bug. We want to get the date of the last month with the same day. If we put 1, the timestamp will be wrong, but yes, february has got only 28 days so you would need some verifications in your script to see if(date('m') == 02 && date('d') > 28) ... In the manual we will not make too complex scripts. Previous Comments: ------------------------------------------------------------------------ [2003-04-30 09:14:13] noam at i-com-it dot com in the date function (http://www.php.net/manual/en/function.date.php) Example 3. date() and mktime() example $lastmonth = mktime (0,0,0,date("m")-1,date("d"),date("Y")); i use it in the 31.4 like this: $month= mktime (0,0,0,date("m")-2,date("d"),date("Y")); i got "march"; because february only have 28 days . i use: $month= mktime (0,0,0,date("m")-2,1,date("Y")); instead; noam ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23428&edit=1

« previous php.doc (#969352998) next »