Re: [PHP] Year

2007-02-02 Thread Robert Cummings
On Fri, 2007-02-02 at 20:08 -0600, Richard Lynch wrote: > On Fri, February 2, 2007 7:41 pm, Robert Cummings wrote: > > function 10 times by embedding it in the loop's terminate condition? > > Because 10 calls to date() is chump-change. 10 chumps here, 10 there, 100 there, sloppy here, sloppy ther

Re: [PHP] Year

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 7:41 pm, Robert Cummings wrote: >> for ($year = date('Y'); $year <= date('Y') + 10; $year++){ >> $short_year = $year - 2000; $short_year = sprintf('%02d', $short_year); >> echo "$year\n"; >> } >> >> Using the 2-digit year as your value is almost for sure a really Bad

Re: [PHP] Year

2007-02-02 Thread Robert Cummings
On Fri, 2007-02-02 at 19:02 -0600, Richard Lynch wrote: > On Fri, February 2, 2007 9:11 am, Dan Shirah wrote: > > I am trying to populate a dropdown list to contain the current year to > > 10 > > years in the future. Below is the code I'm using: > > > > > for ($y=0;$y<=10;$y++) { > > $years=d

Re: [PHP] Year

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 9:11 am, Dan Shirah wrote: > I am trying to populate a dropdown list to contain the current year to > 10 > years in the future. Below is the code I'm using: > >for ($y=0;$y<=10;$y++) { > $years=date ('Y')+$y; > $short_years=date

Re: [PHP] Year

2007-02-02 Thread Dan Shirah
Thanks everyone! A lot of great solutions! On 2/2/07, chetan rane <[EMAIL PROTECTED]> wrote: HI Dan try this this should work 100%; echo ""; for ($y=0;$y<=10;$y++) { $years=date('Y')+$y; $short_years=date('y')+$y; printf("%d",$short_years,$years); } echo ""; On 2/2/07, Dan Shirah <[EMAIL P

Re: [PHP] Year

2007-02-02 Thread chetan rane
HI Dan try this this should work 100%; echo ""; for ($y=0;$y<=10;$y++) { $years=date('Y')+$y; $short_years=date('y')+$y; printf("%d",$short_years,$years); } echo ""; On 2/2/07, Dan Shirah <[EMAIL PROTECTED]> wrote: Hello all, I am trying to populate a dropdown list to contain the current ye

Re: [PHP] Year

2007-02-02 Thread Németh Zoltán
On p, 2007-02-02 at 10:11 -0500, Dan Shirah wrote: > Hello all, > > I am trying to populate a dropdown list to contain the current year to 10 > years in the future. Below is the code I'm using: > >for ($y=0;$y<=10;$y++) { > $years=date ('Y')+$y; > $short_years=date <

Re: [PHP] Year

2007-02-02 Thread Robert Cummings
On Fri, 2007-02-02 at 10:21 -0500, Robert Cummings wrote: > On Fri, 2007-02-02 at 10:11 -0500, Dan Shirah wrote: > > Hello all, > > > > I am trying to populate a dropdown list to contain the current year to 10 > > years in the future. Below is the code I'm using: > > > > > for ($y=0;$y<=10;$y

Re: [PHP] Year

2007-02-02 Thread Robert Cummings
On Fri, 2007-02-02 at 10:11 -0500, Dan Shirah wrote: > Hello all, > > I am trying to populate a dropdown list to contain the current year to 10 > years in the future. Below is the code I'm using: > >for ($y=0;$y<=10;$y++) { > $years=date ('Y')+$y; > $short_years=date

[PHP] Year

2007-02-02 Thread Dan Shirah
Hello all, I am trying to populate a dropdown list to contain the current year to 10 years in the future. Below is the code I'm using: http://php.net/date>('Y')+$y; $short_years=date ('y')+$y; echo "$short_years"; echo "$years"; } ?> I want the selection value to be 200

Re: [PHP] year 2002 strtotime problem

2001-11-01 Thread John Clarke
Original Message- From: John Clarke [mailto:[EMAIL PROTECTED]] Sent: 2. marraskuuta 2001 9:11 To: [EMAIL PROTECTED] Subject: Re: [PHP] year 2002 strtotime problem Even more funny... I cut and pasted your code and I got; Wed Dec 12 2001 Sat Mar 1 2003 2001-12-12 2001-03-01 What version of Ph

RE: [PHP] year 2002 strtotime problem

2001-11-01 Thread Niklas Lampén
Great. :) I've got PHP 4.0.6 on linux. You? I think you should break the dates manually, it would be the most sure way to do it. Niklas -Original Message- From: John Clarke [mailto:[EMAIL PROTECTED]] Sent: 2. marraskuuta 2001 9:11 To: [EMAIL PROTECTED] Subject: Re: [PHP] year

Re: [PHP] year 2002 strtotime problem

2001-11-01 Thread John Clarke
1.""; > print $date2.""; > > print date("Y-m-d", strtotime($date1)).""; > print date("Y-m-d", strtotime($date2)).""; > ?> > > And the result was this: > " > Wed Dec 12 2001 > Sat Mar 1 2003 > 2001-12-12 &

RE: [PHP] year 2002 strtotime problem

2001-11-01 Thread Niklas Lampén
Niklas -Original Message- From: John Clarke [mailto:[EMAIL PROTECTED]] Sent: 2. marraskuuta 2001 8:17 To: [EMAIL PROTECTED] Subject: [PHP] year 2002 strtotime problem I have this problem with Php 4.0.5 on both Win ME and Linus boxes, where my year 2002 dates are converted back to 2001 wh

[PHP] year 2002 strtotime problem

2001-11-01 Thread John Clarke
I have this problem with Php 4.0.5 on both Win ME and Linus boxes, where my year 2002 dates are converted back to 2001 when formating with 'strtotime'. First I post the following variables from an html page to a php page $date1='12/12/2001' $date2='15/01/2002' I then use date("D M j Y", strtot