Checking participants' local time | XM Community
Skip to main content
Solved

Checking participants' local time

  • April 22, 2023
  • 6 replies
  • 513 views

Forum|alt.badge.img+2

Hello,

I am collecting data using a Qualtrics survey, and the participants are from different time zones. I know Qualtrics records start/end/recorded date and time based on my local time zone. Is there a way to check the participants’ local time when they submit the survey?

I know I can add a question and directly ask them to indicate their local time or calculate their local time based on the latitude and longitude info. I am just wondering if there are other more accurate and convenient ways to do it. I think I saw somewhere that Qualtrics automatically records participants’ local time, but I am not sure if it is true and if so, how to retrieve that information.

Thank you very much!

Best answer by Shashi

Before the last question add a text entry question and paste the below script in JS of the question. The script will capture the local date time and punch it in text entry question and auto advance.

    jQuery("#"+this.questionId).hide();
    jQuery("#"+this.questionId+" .InputText").val(new Date().toString());
    this.clickNextButton();

 

6 replies

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • 654 replies
  • Answer
  • April 22, 2023

Before the last question add a text entry question and paste the below script in JS of the question. The script will capture the local date time and punch it in text entry question and auto advance.

    jQuery("#"+this.questionId).hide();
    jQuery("#"+this.questionId+" .InputText").val(new Date().toString());
    this.clickNextButton();

 


Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • 2050 replies
  • April 23, 2023

If you create an embedded data in the survey flow, click on the right to set it's value, an arrow will appear, in this drop down, you'll have multiple options for date and time. Same goes for Piped text. 


CxEx
Level 5 ●●●●●
Forum|alt.badge.img+13
  • Level 5 ●●●●●
  • 70 replies
  • April 23, 2023

You can use embedded field to capture current date and time, but i suppose it will show the time you have in your account settings.


Forum|alt.badge.img+2
  • Author
  • 1 reply
  • April 24, 2023

Before the last question add a text entry question and paste the below script in JS of the question. The script will capture the local date time and punch it in text entry question and auto advance.

    jQuery("#"+this.questionId).hide();
    jQuery("#"+this.questionId+" .InputText").val(new Date().toString());
    this.clickNextButton();

 

It works! This is super helpful. Thanks a lot!!


Forum|alt.badge.img
  • 2 replies
  • September 11, 2024

Hello,

Shashi’s script seems to be exactly what I need; however, I am unable to get it to function.

I’ve pasted it as shown, as well as by itself without the Qualtrics.SurveyEngine.addOnload(function(){}; outer argument:

 

but the question still appears in the survey as a text entry (it isn’t skipped as the script prompts), and the Date isn’t being recorded in the data.

 

Is there something additional that needs to be done to get this sort of javascript to function?


Forum|alt.badge.img
  • 2 replies
  • September 12, 2024

Hello,

Shashi’s script seems to be exactly what I need; however, I am unable to get it to function.

I’ve pasted it as shown, as well as by itself without the Qualtrics.SurveyEngine.addOnload(function(){}; outer argument, but the question still appears in the survey as a text entry (it isn’t skipped as the script prompts), and the Date isn’t being recorded in the data.

 

Is there something additional that needs to be done to get this sort of javascript to function?

UPDATE: After speaking with the support team, the Simple layout breaks this. Converting the survey to the Flat layout solves the issue.