Displaying the date from 3 months ago
I have created a course which displays the current date on screen.
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var dateString=day + "/" + month + "/" + year
var player = GetPlayer();
This works fine however I want the date to change to 3 months previous when the user clicks a button, so example the current date is: 10/03/15 and when the user clicks the button it changes to: 10/01/15.
I edited the code to
- 1 rather than
+ 1 and this worked however if I set my system clock to 10/01/15 and ran the course again the output is displayed as "10/-1/15" instead of the correct date of "10/10/14"
Does anyone have any suggestions?