Re: Newbie needs to varify a calendar date



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
.



Relevant Pages

  • Re: Soymail not working with WASD
    ... A 404 can also indicate the server account does not have permission to ... Once authentication is going I suspect we may be back to analysing the ... prohibits any account other than those holding a specific rights identifier. ... WATCH is a tool that if it doesn't indicate exactly the reason for any ...
    (comp.os.vms)
  • Re: Soymail not working with WASD
    ... A 404 can also indicate the server account does not have permission to ... Once authentication is going I suspect we may be back to analysing the ... prohibits any account other than those holding a specific rights identifier. ... WATCH is a tool that if it doesn't indicate exactly the reason for any ...
    (comp.os.vms)
  • Calc Prorated Cost based on Specific Days in a Given Month & Year Range
    ... The tricky part is that the price ... This is all based on the annual cost, ... Till Leap Year gives it twenty-nine. ... Taking into account that the service ended on March 16th, ...
    (microsoft.public.excel)
  • Re: YACD which holes to cover? [V]
    ... You mean, watch him die spectacularly? ... To whomever is fucking with my Google Groups account, ... present this evidence to his ISP hopefully he won't be a thorn in my ... when I do your net access won't live to tell the tale.) ...
    (rec.games.roguelike.angband)
  • Re: {kjd-imc,kjd-srd} New site access
    ... people can look in and watch what we're doing. ... I won't be interested in making an account unless I ... This includes the forums, though, so if you want to comment you'd need ... "Contributing" doesn't necessarily mean making design decisions and the ...
    (rec.games.frp.dnd)