From: "David A. Black" Date: 2005-08-30T01:48:01+09:00 Subject: Re: Date problem. Hi -- On Tue, 30 Aug 2005, 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 require 'date' d = Date.today puts Date.new(d.year, d.month-1, 1).strftime("%Y-%m-%d") David -- David A. Black dblack@wobblini.net