Menu
Doing an assignment for school. I need to use javascript to get the date, write it in HTML, then increase the date and then write it again. Here’s what I have so far:
[code=php]var today = new Date();
var n = today.toTimeString();
document.write(“<p>” + n + “</p>”);
var x = today.setMonth(today.getMonth() + 1);
document.write(“<p>” + x + “</p>”);
The first document.write works great. The second one however, puts out a strange string of numbers. (1399583497190)
I’m not sure what I’m doing wrong. Some help, please?