Jeff Oien wrote:
When I do this:
$lastmonth = mktime(0, 0, 0, date(m)-9, date(d), date(Y));
this will not work most of the year, if current month is August or less,
the month value will be negative.
Use strtotime('-9 months') instead.
--
PHP General Mailing List (http://www.php.net/)
To
Marek Kilimajer wrote:
Jeff Oien wrote:
When I do this:
$lastmonth = mktime(0, 0, 0, date(m)-9, date(d), date(Y));
this will not work most of the year, if current month is August or less,
the month value will be negative.
Use strtotime('-9 months') instead.
This code works just fine for me:
On Sun, 21 Mar 2004, Marek Kilimajer wrote:
Jeff Oien wrote:
When I do this:
$lastmonth = mktime(0, 0, 0, date(m)-9, date(d), date(Y));
this will not work most of the year, if current month is August or less,
the month value will be negative.
mktime() can take negative values just fine.
When I do this:
$lastmonth = mktime(0, 0, 0, date(m)-9, date(d), date(Y));
echo $lastmonth;
It prints this:
1056081600
Could you tell me what I'm missing? Thanks and thanks for the previous
help.
Jeff Oien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
mktime returns an Unix Timestamp, you need to format it using
date( [form] , [timestamp] ).
http://php.net/date
Jeff Oien wrote:
When I do this:
$lastmonth = mktime(0, 0, 0, date(m)-9, date(d), date(Y));
echo $lastmonth;
It prints this:
1056081600
Could you tell me what I'm missing? Thanks and
5 matches
Mail list logo