{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":9323,"path":"employee-service-management/contact-tracing/add-script-include-contact-tracing.md","title":"Configure the time zone setting for badge and daily log data","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure the time zone setting for badge and daily log data\n\nAdd a script include in the Global scope to consider the affected user's time zone when you run a diagnostic request using the badge reader or user daily log data source.\n\n## Before you begin\n\nRole required: admin\n\n## Procedure\n\n1.  Navigate to **All** &gt; **System UI** &gt; **Script Includes**.\n\n2.  Click **New**.\n\n3.  In the **Name** field, enter `TimeZoneUtils`.\n\n4.  From the Accessible from list, select **All application scopes**.\n\n5.  Copy the following script into the **Script** field.\n\n    ```\n    var TimeZoneUtils = Class.create();\n    TimeZoneUtils.prototype = {\n    \tinitialize: function() {\n    \t},\n    \tgetTimeZone: function(timeZoneString) {\n    \t\treturn Packages.java.util.TimeZone.getTimeZone(timeZoneString);\n    \t},\n    \tgetTimeZoneOffSet: function(timeZoneString, gdt) {\n    \t\tvar timeZoneObj = this.getTimeZone(timeZoneString);\n    \t\tvar dateTime = new GlideDateTime();\n    \t\tif (gdt) {\n    \t\t\tdateTime.setValue(gdt);\n    \t\t}\n    \t\tdateTime.setTZ(timeZoneObj);\n    \t\treturn dateTime.getTZOffset();\n    \t},\n    \tgetBoundaryDates: function(timeZoneString, offset, dateTime) {\n    \t\tvar tz = this.getTimeZone(timeZoneString);\n    \t\tvar gd = new GlideDateTime();\n    \t\tgd.setValue(dateTime);\n    \t\tgd.add(offset);\n    \t\tvar startTime = '00:00:00';\n    \t\tvar endTime = '23:59:59';\n    \t\tvar actualDate = new GlideDate();\n    \t\tactualDate.setValue(gd.getValue());\t\t\n    \t\tvar startDateTime = new GlideDateTime();\n    \t\tstartDateTime.setTZ(tz);\n    \t\tstartDateTime.setDisplayValueInternal(actualDate + ' ' + startTime);\n    \t\tvar endDateTime = new GlideDateTime();\n    \t\tendDateTime.setTZ(tz);\n    \t\tendDateTime.setDisplayValueInternal(actualDate + ' ' + endTime);\n    \t\treturn {\n    \t\t\tstartDateTime: startDateTime,\n    \t\t\tendDateTime: endDateTime\n    \t\t};\n    \t},\n    \ttype: 'TimeZoneUtils'\n    };\n    ```\n\n6.  Click **Submit**.\n\n\n## Result\n\nThe script is used when you run the diagnostic request using the badge reader or user daily log data source. These data sources identify the potentially exposed users who might have come in contact with an affected user. The script considers the affected user's time zone while calculating the date and time from the badge swipe data or daily log data.\n\n**Parent Topic:**[Setting up Contact Tracing](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/contact-tracing/set-up-contact-tracing.md)\n\n"}}