Calcuations with time data

Mehr
4 Jahre 2 Monate her #100958 von kateporcheret
kateporcheret erstellte das Thema Calcuations with time data
Hello,

I am creating a survey to look at sleep and need to know bed times and get up times. I would like to be able to provide people with feedback about their sleep such as sleep duration. To do this I need to do some simple calculations with the times they provide. I have made questions with hour and minute drop down boxes, but can't figure out how to do the calculations. In excel I would use: wake time +(24-bed time). Is there a way to do this is LimeSurvey?

Thanks

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 2 Monate her #100962 von mfaber
mfaber antwortete auf das Thema: Calcuations with time data
You may be able to do this using the function strtotime(). It's fairly new in LS and seems to work well with dates. I have not tested it myself to work with times but in principle it should work. Have a look here:
manual.limesurvey.org/Expression_Manager...ce_between_two_dates
and here:
www.php.net/manual/en/function.strtotime.php

Please be aware that strtotime() works with a lot of different but not ALL date formats. Limesurvey's default date format (MM-DD-YYYY) does NOT work with strtotime(). Please set your survey to use one of the following date formats to avoid problems: YYYY-MM-DD, YYYY/MM/DD, DD.MM.YYYY, MM/DD/YYYY, DD-MM-YYYY.
For times, you are probably on the safe side using HH:MM
Folgende Benutzer bedankten sich: kateporcheret

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 2 Monate her #100963 von Ben_V
Ben_V antwortete auf das Thema: Calcuations with time data
hi,
if you want to go further with time calculation it may be better to retrieve times using just one (numerical) question.
Have a look here to get another approach using a 'timepicker' question

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Folgende Benutzer bedankten sich: kateporcheret

Bitte Anmelden um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha