ANNOUNCE: DateTime 0.1702

2003-09-18 Thread Dave Rolsky
0.1702 2003-09-18 - Added truncate( to => 'week' ). Suggested by Flavio Glock. -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/

Re: Some examples for the FAQ

2003-09-18 Thread Dave Rolsky
On Sat, 13 Sep 2003 [EMAIL PROTECTED] wrote: > > For example, the Wednesday of the current week is: > > > > my $today = DateTime->today; > > > > my $wednesday = $today - ( $today->day_of_week - 3 ); > > How about adding a 'week' parameter > to the 'truncate' method: > > print DateTime->today >

Re: figuring out the number of sundays in a given year

2003-09-18 Thread Flavio S. Glock
Hill, Ronald wrote: > > > sub jan1{ > > my $y = shift; > > my $m = 1; $d = 1; > ^^ > why is that there? and I don't understand why you set $m to 1 > and then set it to 11? > > > $m = 11; $y--; > > my $c = int($y / 100); $yy = $y %100; > > my $z = ( 1 + $yy + int($yy/4) + i

RE: figuring out the number of sundays in a given year

2003-09-18 Thread Hill, Ronald
Hi Syamala, > Here is a simple solution (unless you are bent on doing > it in a longer way using the class in ref.) The project I have started on is using DateTime for other things, so I figured I would use it here as well. Besides I don't think what I wrote is doing it the long way, granted

Re: figuring out the number of sundays in a given year

2003-09-18 Thread Dave Rolsky
On Thu, 18 Sep 2003, Syamala Tadigadapa wrote: > Here is a simple solution (unless you are bent on doing it in a longer way > using a date time class.) Yeah, because letting others do the repeated work for you would be silly. > sub jan1{ > my $y = shift; > my $m = 1; $d = 1; > $m = 11; $