From: Joe Van Dyk Date: 2005-08-30T02:11:08+09:00 Subject: Re: Date problem. There's gotta be a better way of doing this, but: irb(main):001:0> require 'date' irb(main):002:0> puts Date.civil(2005, (DateTime.now.month) -1, 1) 2005-07-01 On 8/29/05, ober wrote: > I have read over the man pages and can not seem to find a way to do the > following > > > -----php--------------- > $lastmonth = mktime(0, 0, 0, date("m")-1, date(01), date("Y")); > $name = date('Y-m-d', $lastmonth); > echo "$name\n"; > ----php---------------- > > Where the first day of the previous month is listed. > In this case you would get 2005-07-01 > > Thanks in advance. > >