View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 20859 | Bug reports | Survey participants (Tokens) | public | 2026-11-16 20:51 | 2026-11-16 20:51 |
| Reporter | francois-charles.hebert | Assigned To | |||
| Priority | none | Severity | partial_block | ||
| Status | new | Resolution | open | ||
| Product Version | 7.9.x | ||||
| Summary | 20859: Participant "Valid from" / "Valid until" are saved and displayed without timezone conversion, but enforced in UTC | ||||
| Description | The "Valid from" and "Valid until" dates of a survey participant do not behave according to the timezone of my account. My administrator account is set to America/Toronto (UTC-5 at this time of year). When I enter a "Valid until" date in the participant form, the participant loses access to the survey 5 hours before the time I entered. In the same way, a participant can enter the survey 5 hours before the "Valid from" time. Example: at 14:38 local time, I set "Valid until" to 16:00 the same day. The participant form still shows 16:00, but the access code is immediately refused with "This invitation is not valid anymore." Looking at the database, the value is saved exactly as I typed it (16:00:00), with no conversion to UTC. The survey then seems to compare it to the current UTC time (19:38 in my example), so the date is treated as UTC when access is checked, but as local time when I enter it and when it is displayed. Other dates do not have this problem: the survey start and expiry dates are converted to my timezone, and the "sent", "remindersent" and "completed" columns are stored in UTC. The same raw value is shown in the participant list, in the CSV export, and in the {VALIDFROM} / {VALIDUNTIL} email placeholders, so participants can also receive an invitation showing a validity date that is not the one actually applied. I had a look at the code and the validity checks all use gmdate() (Token.php scopes "usable" / "editable", SurveyIndex.php, Tokens.php email(), token_helper.php emailTokens(), remotecontrol_handle.php), while the participant form in Tokens.php only reformats the date without converting it from the display timezone. | ||||
| Steps To Reproduce | Steps to reproduce
Variant for "Valid from": set "Valid from" to today at 12:00 (2 hours in the future in local time), leave "Valid until" empty, and open the survey with the access code. Expected resultThe participant can access the survey until 12:00 local time (17:00 UTC), as shown in the participant form. The value should be stored in UTC ("YYYY-MM-DD 17:00:00") and converted back to the display timezone in the form, the table, and the email placeholders. Variant: the survey should not be accessible before 12:00 local time. Actual resultThe survey is refused with "This invitation is not valid anymore.", although the form shows an expiry 2 hours in the future. The stored value "12:00:00" is compared to gmdate(), which returns 15:00. Variant: the survey is accessible immediately, 2 hours before the "Valid from" time shown in the form. In both cases the validity window is shifted by the UTC offset of the administrator's timezone (5 hours earlier for America/Toronto in winter, 4 in summer). (Write here what happened instead) | ||||
| Tags | No tags attached. | ||||
| Bug heat | 0 | ||||
| Complete LimeSurvey version number (& build) | 7.9.0 | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | |||||
| Database type & version | mariadb 10.11.17 | ||||
| Server OS (if known) | |||||
| Webserver software & version (if known) | |||||
| PHP Version | 8.4 | ||||
| Git branch / Pull Request URL | |||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-16 20:51 | francois-charles.hebert | New Issue |