View Issue Details

This issue affects 1 person(s).
 0
IDProjectCategoryView StatusLast Update
20859Bug reportsSurvey participants (Tokens)public2026-11-16 20:51
Reporterfrancois-charles.hebert Assigned To 
PrioritynoneSeveritypartial_block 
Status newResolutionopen 
Product Version7.9.x 
Summary20859: 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

  1. Set the timezone of your administrator account to a non-UTC timezone, for example America/Toronto (UTC-5 in winter).
  2. Create a survey, activate it, and initialise the survey participants table (closed-access mode).
  3. Note the current local time. Example: 10:00 in Toronto, which is 15:00 UTC.
  4. Add a participant and set "Valid until" to today at 12:00, i.e. 2 hours in the future in local time. Leave "Valid from" empty. Save.
  5. Check the database: tokens_<sid>.validuntil contains "YYYY-MM-DD 12:00:00", the value as typed, not converted to UTC.
  6. Open the survey with this participant's access code.

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 result

The 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 result

The 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)

TagsNo tags attached.
Bug heat0
Complete LimeSurvey version number (& build)7.9.0
I will donate to the project if issue is resolvedNo
Browser
Database type & versionmariadb 10.11.17
Server OS (if known)
Webserver software & version (if known)
PHP Version8.4
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-11-16 20:51 francois-charles.hebert New Issue