Get an UTC EndDate on a javascript code interceptor | XM Community
Skip to main content

Hello,

Here is my situation:

 

I have a survey on Qualtrics and I have a Survey Respose event, wich have a javascript task interceptor to collect the response data and use for integrations.

 

In the respose, we have de “EndDate” field, wich is automatic filled by Qualtrics when the user completely responds the survey.

How I get the field: const dataQx = new Date("${rm://Field/EndDate}");

 

The problem is that the “EndDate” comes with a UTC-7 timezone when a get from javascript.

I need to collect this date in a UTC timezone without making a custom sum of hours in the javascript.

 

When i collect this same response data through the Qualtrics api, the date is in UTC timezone. I need the same behavior in the javascript interceptor.

API: https://ca1.qualtrics.com/API/v3/surveys/survey_ID/responses/ResponseID

 

Example:

Value on my actual time zone (UTC-3): 01-01-2024 10:00:00

Value that I get in the API response (UTC): 01-01-2024 07:00:00

Value that I get in the javascript code interceptor (UTC-7): 01-01-2024 00:00:00

 

Is there a way to get the “EndDate” in the UTC timezone in the javascript code interceptor just like the response in the API?

Thanks for the attention.

Be the first to reply!

Leave a Reply