# Can I insert a date that is X days into the future into the last page?

3 years 9 months ago #127994 by zetetic
I want to incentivize my survey by offering a coupon at the end of the session. I would like that coupon to be valid for X days which would mean calculating a date that is X days in to the future. Can that be done using one of the expression functions?

Thank you all

LimeSurvey Partners
3 years 9 months ago #128023 by tpartner
This expression will give a date 7 days from present (the 604800 is the number of seconds in 7 days):

{date('d/m/Y' , time()+604800)}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

3 years 9 months ago #128040 by zetetic
Is there a special way to insert this? When I do this, this appears:

< / span > < spanstyle="color: rgb(153, 0, 0);" > date < / span > < spanstyle="color: rgb(0, 153, 0);" > ( < / span > < spanstyle="color: rgb(0, 0, 255);" > 'd/m/Y' < / span > < spanstyle="color: rgb(51, 153, 51);" > , < / span > < spanstyle="color: rgb(153, 0, 0);" > time < / span > < spanstyle="color: rgb(0, 153, 0);" > ( < / span > < spanstyle="color: rgb(0, 153, 0);" > ) < / span > < spanstyle="color: rgb(51, 153, 51);" > + < / span > < spanstyle="color: rgb(204, 102, 204);" > 604800 < / span > < spanstyle="color: rgb(0, 153, 0);" > ) < / span > < spanstyle="color: rgb(0, 153, 0);" >

3 years 9 months ago #128053 by tpartner
It is inserted as any other Expression Manager expression. Here's a sample equation type question:

#### File Attachment:

File Name: limesurvey...5849.lsq
File Size:2 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
##### Attachments:

3 years 9 months ago #128072 by holch
You can't insert this via the WYSIWYG editor, you need to write it into the source code / plain text view.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.