Beginnerprogrammer Beginnerprogrammer - 2 years ago 87
Javascript Question

How to stop code from running on a specific date

I want to stop a specific part of my code from running when its 29th of may. Someone can help me out on this with


Answer Source

You can try something like this,

var CurrentDate = new Date();
var YourSelectedDate = new Date(2016, 04, 29, 10, 15); //Here it is 29th may 2016

    if(CurrentDate > YourSelectedDate ){
        //CurrentDate is more than YourSelectedDate 
       // Display warning message or whatever you want to display.
        //YourSelectedDate is more than CurrentDate
        //put your code in this part.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download