Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9094057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:15:30+00:00 2026-06-16T23:15:30+00:00

I am trying to compare a date in JS with todays date. This is

  • 0

I am trying to compare a date in JS with todays date. This is what my code looks like.
But when I try to compare the date for 01/07/2014 then this is not working.
What am I doing wrong?

var chsRedirectDate = "04/01/2013" ; //new Date("1 Apr 2013");
var today = new Date();
var dd    = today.getDate();
var mm    = today.getMonth()+1; //January is 0!
var yyyy  = today.getFullYear();

if(dd<10){dd='0'+dd};
if(mm<10){mm='0'+mm};

today = mm+'/'+dd+'/'+yyyy;


if (ee_value.toUpperCase() == 'TEST123') && (today >= chsRedirectDate))
   var url = "test.php" ;
   var newtab = window.open("url", null, "top=190,left=450, dependent=yes, directories=no,location=no,menubar=no,status=no,toolbar=no,titlebar=no,scrollbars=no,width=500,height=250,resizable=yes");
   window.close();
   newtab.location = url;
   newtab.focus();

   return false;

}

if (ee_value.toUpperCase() == 'TEST123') && (today < chsRedirectDate))
{
   alert('Testing');
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:15:31+00:00Added an answer on June 16, 2026 at 11:15 pm
    var today = new Date();
    var otherDay = new Date("04/01/2013");
    
    alert(today >= otherDay);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to compare the date but its not comparing the date like
I'm trying to compare two different column types (not my doing, part of a
Now I'm trying to make helper method like this. How can I compare the
I'm trying to compare just the date of a column but because the query
I have the following code,and I am trying to compare The date string with
I'm trying to compare two dates with the current date. It seems not to
I am trying to compare a date against the first of next month from
Im trying to compare these two chars but on win 32 Visual Studio 2008:
I'm trying to compare the differences between jQuery and JavaScript in a project, but
this may seem like a stupid question, but it is stumping me nontheless. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.