Actions

Translations

Translations:Question type - Date/27/en

From LimeSurvey Manual

Revision as of 17:27, 23 January 2014 by FuzzyBot (talk | contribs) (Importing a new version from external source)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Limesurvey versions 2.05+ and above make it fairly easy to validate dates using the date_min and date_max fields (see above). Use these whenever possible. If you need to do more fancy stuff, you may be able to work (and calculate) with dates using Expression Manager and the function strtotime() (New in 2.0 build 130515). It calculates the number of seconds from the 1st January 1970 to a given date. Example: if you want to display in a question text the number of days that have passed since a departure date (asked in a previous question) and today, you can can use the expression {(strtotime("now")-strtotime(departure))/60/60/24}. 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.