Search found 2 matches

by JonathanS
Fri Feb 29, 2008 4:26 pm
Forum: PHP - Code
Topic: Leap year(s) in five year period
Replies: 3
Views: 205

Re: Leap year(s) in five year period

date('L', mktime(12, 0, 0, 1,1,'2008')); $startYear = substr($_POST['from_yr'], -2); $endYear = substr($_POST['to_yr'], -2); $leaps = 0; for($i=$startYear; $i<=$endYear; $i++) { if(date('L', mktime(12,0,0,1,1,$i))) $leaps++; } If i input 28 february 2008 - 28 february 2013 i get 5 years 0 monts and ...
by JonathanS
Thu Feb 28, 2008 5:30 pm
Forum: PHP - Code
Topic: Leap year(s) in five year period
Replies: 3
Views: 205

Leap year(s) in five year period

Hope someone can help me. User defines two dates(dd/mm/yy, then want to display 1) Difference in days between the two inputs in dd/mm/yy and 2) the difference in days between the dates. The problem is I always want to show the difference i dd/mm/yy no matter how long the period is but the maximun va...