Welcome to the LimeSurvey Community Forum

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

Conditions with Date/Time questions

  • mike01
  • mike01's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 1 month ago #117346 by mike01
Conditions with Date/Time questions was created by mike01
Hello there,

I have a Date/Time question and my next question should appears only if that date (previous question) is more than 6 months ago..

How can I add that condition?

Sample:

Today Feb 16, 2015

Next question should appears only if the date I enter is Ago 16, 2014 or prior that date.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 month ago - 9 years 1 month ago #117362 by tpartner
Replied by tpartner on topic Conditions with Date/Time questions
You can use the Expression Manager date() and strtotime() functions to compare today's date timestamp to a timestamp 183 days ago (183 days = 15811200 seconds). So, if your date question has a code "qDate", something like this:

Code:
qDate && (strtotime(date('Y-m-d')) - strtotime(qDate) > 15811200)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 9 years 1 month ago by tpartner.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose