Using the following code to add an extra day to a Date, however, it returns the value in numbers.
expiryDate = oldDate.setDate(olDate.getDate() + 1);
document.write(expiryDate);
Returns 1396393199000
Then, i tried formatting
expiryDate = oldDate.setDate(olDate.getDate() + 1);
document.write(format(expiryDate, "%2D/%2M/%2Y"));
And I get the following error;
Error while evaluating document Date '1396393199000': invalid character at position 5 ('3') JavaScript: error while evaluating script 'content htmlContent'.
Any advice?
format()function?olDateandoldDate, is that a typo?oldDatetoformat()instead ofexpiryDate. ThesetDate()method will mutate the original object.setDatedoesn't return a new Date