Reply to Re: i write a date calculator, but there always get a one-day-distance wrong

Your name:

Reply:


Posted by Jerry Stuckle on 08/28/06 20:54

Steve wrote:
> On Sun, 27 Aug 2006 06:36:09 -0700, Gucci wrote:
>
>
>> if ($year%100==0) {
>> if ($year%400==0) {$flag = true;}
>
>
> Are you *sure* this logic is correct? I'm not... and if it is, why bother
> with the check for 100 years?
>

Yes, that is correct.

It is a leap year if the year is divisible by 400, or if its divisible
by 4 and not by 100.

He needs the $year % 100 for the else clause.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация