Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

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

  • zetetic
  • zetetic's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 5 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
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 5 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):

Code:
{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.
The topic has been locked.
  • zetetic
  • zetetic's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 5 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);" >
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 5 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.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 5 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 answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose