Team:KULeuven/Tools/New Day/Date Retriever

From 2008.igem.org

(Difference between revisions)
m
Line 24: Line 24:
}
}
var year = parseInt(dateTokens[2]);
var year = parseInt(dateTokens[2]);
-
alert(year + '_' + month + '_' + day);
+
 
// Construct a Date object and return the result
// Construct a Date object and return the result
var date = new Date();
var date = new Date();
date.setFullYear(year, month, day);
date.setFullYear(year, month, day);
-
alert(date.toUTCString());
 
return date;
return date;
Line 36: Line 35:
function datePast(ndays) {
function datePast(ndays) {
var pastDate = new Date();
var pastDate = new Date();
-
alert(pageDate().getDate().toUTCString());
+
alert(pageDate().getDate().toGMTString());
pastDate.setDate(pageDate().getDate() - ndays);
pastDate.setDate(pageDate().getDate() - ndays);
return pastDate;
return pastDate;

Revision as of 08:31, 1 August 2008

<< return to notebook return to homepage >>
< previous friday ← yesterday tomorrow → next monday >