-
Date given + 7 or something else
I’m given an upload date in a text file.
example 2017-08-08
I need an expression that will take this static date and add 7.
So that it works out
current date might be 2017-08-10;
date1 = 20170808
date2 = 20170815The problem is, I can’t simply just put 20170808 + 7, well I could in this case, but not 20170831, because this will go above an actual date.
D = new Date(new Date(Date(0)).getTime()+1*24*60*60*1000);
D.getDate();I can’t use this expression for date2 because I need it to be + 7 from date1, otherwise I can’t use my try catch expression
So the final result would be. Someone uploads an image that gets replaced, no script. Just a simple find and replace in a folder with an updated .txt document (Containing a name, location and upload date). After 7 days, if this file isn’t replace. It goes back to the default image below.
My expression currently works fine, but the guy who’s providing the data, says it’s too much hassle to set his system to include an expiry date rather than an upload date. If I got an expiry date, I could just use an expression if(expiry > date). I wouldn’t be having to ask for any help.
Can anyone think of a way to take the date I’ve been given and create a new date +7 based off that date. I’ve got the expression nailed down for the rest, just need this part.