Team:KULeuven/Tools/New Day/Date Retriever

From 2008.igem.org

(Difference between revisions)
m
m
Line 19: Line 19:
var day = parseInt(dateTokens[0]);
var day = parseInt(dateTokens[0]);
-
var month = -1;
+
var month = 0;
for (x in monthNames) {
for (x in monthNames) {
if(dateTokens[1] == monthNames[x]) {month += parseInt(x); break;}
if(dateTokens[1] == monthNames[x]) {month += parseInt(x); break;}
Line 28: Line 28:
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;

Revision as of 08:27, 1 August 2008

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