compare dates in javascript

Results 1 to 3 of 3

Thread: compare dates in javascript

  1. #1
    Join Date
    Dec 1969

    Default compare dates in javascript

    hello guys,<BR>i need to compare a date which if of the mm/dd/yy form. i want to find out whether this date is todays date or greater than todays . if it is lesser it will give the user an error.<BR>any clues

  2. #2
    Join Date
    Dec 1969

    Default RE: compare dates in javascript

    not real familiar with javascript, but see if this helps.<BR><BR><BR><BR>and after reading what they show, you can use this for the current date.<BR><BR>now = new Date()

  3. #3
    Join Date
    Dec 1969

    Default Not quite true...

    In JS, <BR> var now = new Date();<BR>will set the now variable to the current date *AND* time.<BR><BR>If having the time in there causes problems, then you can do:<BR> var now = new Date();<BR> var today = new Date( now.getFullYear(), now.getMonth(), now.getDate() );<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts