Re: Newbie needs to varify a calendar date
- From: Rik <luiheidsgoeroe@xxxxxxxxxxx>
- Date: Fri, 26 Jan 2007 19:29:25 +0100
Tom <tom@xxxxxx> 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
.
- Prev by Date: Re: Binary-safe?
- Next by Date: Re: problems with reading email with php
- Previous by thread: Open Source replacement for cpanel's MySQL Databases other than myphpadmin?
- Next by thread: Spell Check, Grammar Check; Output to Word, PowerPoint
- Index(es):
Relevant Pages
|