I know there are many threads on this, but I couldn't find an answer to my particular case... I have my script working and doing exacltly what I want it to, it's now a question of formatting... I'm using this to get a variable date and if that date falls on a Saturday or Sunday, I'm adding 2 days... The problem I cant figure out is where to format the date I get returned to a format I choose... (MM/dd/yy) or (yyyy-MM), etc... Here is the code... Any help would be appreciated...
Code: Select all
milday = 86400000;
d = new Date();
d = new Date(2019, 3, 23);
dmil = Date.parse(d.toString());
x = d.getDay();
if (x > 5)
{
dmil = dmil + (milday * 2);
}
datenew = new Date(dmil)
PDSource1 = datenew;