date math

2004-03-27 Thread Andrew Gaffney
I'm looking for a way to do some date math. I'm working on a payroll tracking system. I want to provide a list of 2 week periods for the user to select. These periods start from a hard-coded known start of pay period date. I want it to display the 6 most recent 2 week periods. For e

Re: date math

2004-03-27 Thread Andrew Gaffney
Chris Charley wrote: Hello Andrew I've enclosed a text file that demonstrates Date::Simple. HTH Chris - Original Message - From: "Andrew Gaffney" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "beginners" <[EMAIL PROTECTED]> Sent: Saturday, Marc

Re: date math

2004-03-28 Thread Andrew Gaffney
Chris Charley wrote: Hello Andrew I've enclosed a text file that demonstrates Date::Simple. HTH Chris - Original Message - From: "Andrew Gaffney" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "beginners" <[EMAIL PROTECTED]> Sent: Saturday, Marc

Re: date math

2004-03-28 Thread R. Joseph Newton
Andrew Gaffney wrote: > > My code ended up looking like: use strict; use warnings; use constant PAY_PERIOD_DAYS => 14; > > > my @payperiods; Underscores are both permissible and advisable in variable names: my @pay_periods; > > my @finalpayperiods; > my $lastperiodend = Date::Simple->new('2004

Re: date math

2004-03-28 Thread Andrew Gaffney
R. Joseph Newton wrote: Andrew Gaffney wrote: My code ended up looking like: use strict; use warnings; This code is running under mod_perl, so I think both of those are already being used. use constant PAY_PERIOD_DAYS => 14; Good idea. I never use constants. My code makes sense to me, but few oth

Re: date math

2004-03-29 Thread Chris Charley
"Andrew Gaffney" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > R. Joseph Newton wrote: > > Andrew Gaffney wrote: [snip] > I didn't do it this way because there is a "first" pay period. If there are only 2 pay > periods from the starting date, you can't build a list of 6. My way t

Re: date math

2004-03-29 Thread Andrew Gaffney
Chris Charley wrote: "Andrew Gaffney" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] R. Joseph Newton wrote: Andrew Gaffney wrote: [snip] I didn't do it this way because there is a "first" pay period. If there are only 2 pay periods from the starting date, you can't build a list