A Forum reader recently asked:
"I have question about how to add a future date to a date field. With IE it gives me the correct date for the datepicker field, but when the date value has been saved to eDirectory, it is shown like "Sun Oct 22 07:11:36 EET 1911". And with Firefox it shows an incorrect value in datepicker field - "11/27/-1753" - which cannot be saved in MM/DD/YYYY format."
And here are the responses from Rudy Duym and John DaSilva ...
You could try the following script inside a workflow form event. This will add 3 days to the current date, and it should work on all browsers :
var s = new Date().getTime();
s = s + 3 * 1000 * 24 * 60 * 60; // add 3 days to today and show that
form.setValues("hireddate", form.dateToString(new Date(s), true));
To add 10 years, to the current date, try:
In Designer, in the Expression builder, there are tooltips for most of the functions. Let the mouse button hover over the Functions/Methods and you will see a note that getYear and setYear are not recommended, because of Y2K. Man, it has been a while since I had to think about that :)
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.