date validation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • weiwei

    date validation

    hi,
    is there anyway that I can validate my date format in javascript?? the
    format should be mmddyy, no space, no dash, and has to include 0 if
    month is from 1-9, for example 01, 02, like that????
    please help me out
    thanks in advance
    Wei
  • Lasse Reichstein Nielsen

    #2
    Re: date validation

    Wei.Huang@slps. org (weiwei) writes:
    [color=blue]
    > is there anyway that I can validate my date format in javascript?? the
    > format should be mmddyy, no space, no dash, and has to include 0 if
    > month is from 1-9, for example 01, 02, like that????[/color]

    Your date format looks correct. Or did you mean to validate dates
    against the date format?

    Following a link from this group's FAQ:
    <URL:http://jibbering.com/faq/>
    I found this page:
    <URL:http://www.merlyn.demo n.co.uk/js-date4.htm#TDVal >

    I would recommend using a four digit year, if nothing else.

    If this is for use on the internet, where you can't assume the
    nationality of the user, you should pick an international date
    format, e.g., yyyy-mm-dd.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    Working...