Date object javascript
Posted
by Isis
on Stack Overflow
See other posts from Stack Overflow
or by Isis
Published on 2010-03-15T09:53:32Z
Indexed on
2010/03/15
9:59 UTC
Read the original article
Hit count: 325
Hello.
var date = new Date();//Mon Mar 15 2010 12:40:05 GMT+0300 (MSK)
var omg = date.getDate() + 19;// 34
date.setDate(omg);
document.write(date.toLocaleString()); //Sat 03 Apr 2010 12:43:00 PM MSK
How do I echo the values 3 (ie: day of month), 4 (April) and the current year?
alert(day); // Need 3
alert(month); // Need 4
Thank you
© Stack Overflow or respective owner