Timezone based on participants' time | XM Community
Skip to main content

Dear all,
For an international project I aim to adjust the piped text for different timezones. Specifically, I want to insert 'Yesterday, November 12th' based on the timezone of the participant rather than that of my account.

To this end, I have set up separate questionnaires for the three different timezones. Yet, I fail to set up a pipe that inserts the correct day depending on the location. To illustrate, my account is set to CET + 1 and a participant from the UK (CET + 0) opening the questionnaire at 11pm (CET + 0) will get the incorrect date using the following pipe: ${date://OtherDate/DM/-1%20day}.

Subtracting/ adding a constant value from the current time is possible when trying to adjust the time for different timezones (${date://OtherDate/G:i/+1%20hours}). However, it is not suitable for inserting the current/previous/... day.

Thanks for your help in advance,
Lukas

Hi,
I found the below discussion that may be helpful to you:
https://community.qualtrics.com/XMcommunity/discussion/3486/how-do-you-get-the-current-time-of-people-based-on-their-time-zone
TomG provides some JS in there that can get the local time of the respondent's device and saves it as an embedded field. You could then use this value to help determine the language that gets shown to the respondent. Below for reference:
Qualtrics.SurveyEngine.addOnload(function() {
var d = new Date();
Qualtrics.SurveyEngine.setEmbeddedData("date", d.toString());
});


Leave a Reply