Date in the future

More
3 weeks 2 days ago #175640 by djct40
djct40 created the topic: Date in the future
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

Please Log in or Create an account to join the conversation.

More
3 weeks 2 days ago #175643 by DenisChenu
DenisChenu replied the 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
3 weeks 2 hours ago #175714 by djct40
djct40 replied the 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

Please Log in or Create an account to join the conversation.

More
3 weeks 1 hour ago #175719 by DenisChenu
DenisChenu replied the 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!