2015-03-13 59 views

回答

0

一種方式是客戶端(當然受到客戶端時鐘):

var start = new Date(2015,2, 1); //start date March 1, 2015, toggle date to test 

var diff = Math.floor((new Date() - start)/86400000); 

if(diff < 30) {  
    alert("Popped because it has only been " + diff + " days"); 
} else { 
    console && console.log("No alert, exceeded 30 days - it's been %o days", diff); 
} 

如果你想服務器端/服務器時間,然後refer to DateTime並觸發警報(例如,注入js,js中的變量等)。

Hth。