Welcome to the LimeSurvey Community Forum

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

Date in the future

  • djct40
  • djct40's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 5 months ago #175640 by djct40
Date in the future was created by djct40
I have a problem producing a date ( in the future)
What i did. : input a date( in the past Q1) Took date of today (Q2) and in an equation worked out the days in between with Strotime.(Q3) Works ok. Now i want to use the output of this equation (Q3) to date of today (q2) to generate a date in the future (Q3+Q2) I tried the Strotime trick but didnt work. In the strotime you have to use the function (round) but strangely if one uses 2 time "round "in 2 questions in one group, the second Q with round gives an error on "Round"(red box)
I am open to sugestions cause this is driving me crazy.The outcome of the "future date" must be in date format
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 months ago #175643 by DenisChenu
Replied by DenisChenu on topic Date in the future
strtotime("next year") must work. Please be more clear in your explanation …

Send a lss sample for exampe …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • djct40
  • djct40's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 5 months ago #175714 by djct40
Replied by djct40 on topic Date in the future
Simplified what i want
Q1 date (does not matter what date) in a date field
Q2 730 (days) (fixed input in a numeral field)
Q3 XXX days ( input field in numeral field)
Q4 Q2 minus Q3
Q5 sum The result of Q4 + Q1 date have to produce a new date

in other words
Date 1 + (730 - xxx) = new date
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 months ago #175719 by DenisChenu
Replied by DenisChenu on topic Date in the future
Did you try

date("Y-m-d",strtotime(Q1.NAOK)+Q4*24*60*60)

or

date("Y-m-d",strtotime(Q1.NAOK)+(730-Q3)*24*60*60)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose