Re: [PHP] 9 Months Ago

2004-03-21 Thread Rasmus Lerdorf
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 valu

Re: [PHP] 9 Months Ago

2004-03-21 Thread Ben Ramsey
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

Re: [PHP] 9 Months Ago

2004-03-21 Thread Marek Kilimajer
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 u

Re: [PHP] 9 Months Ago

2004-03-20 Thread Red Wingate
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? Tha

[PHP] 9 Months Ago

2004-03-20 Thread Jeff Oien
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: http://www.