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

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 me:

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 values just fine.

[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:

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? Thanks and