You are here: Re: Newbie needs to varify a calendar date « All PHP « IT news, forums, messages
Re: Newbie needs to varify a calendar date

Posted by Rik on 01/26/07 18:29

Tom <tom@to.com> wrote:

> On Fri, 26 Jan 2007 09:48:37 +0000, raj wrote...
>>
>> Hi,
>>
>> I have 3 dropdowns. 1 for day, 1 for month and 1 for year.
>>
>> Does anyone have a script that will varify that the date chosen is a
>> real
>> calendar date (i.e takes into account different lengths of months and
>> also
>> leap years)?
>>
>> Thank you in advance,
>>
>> Kind regards,
>>
>> Raj (Newbie)
>>
>
>
> There are a few date settings that are always constant and a couple to
> watch out
> for. There are always 12 months in a year and a month has either 30, 31,
> or 28
> days except leap year where there's 29 in February. You can probably
> define some
> rules, such as which months have how many days. Months might be text
> (Jan.,
> January) or maybe numbers (01, 1, etc) so there's lots of things to
> watch out
> for. : )

Usually I don't bother, just intval() everything and make it a date,
mktime() will swallow faulty dates and change them, i.e. 31-04-2007 will
become 01-05-2007.
--
Rik Wasmus

 

Navigation:

[Reply to this 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

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