1"use strict";(self.webpackChunkreddit_ads_api_site=self.webpackChunkreddit_ads_api_site||[]).push([[3762],{12168:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>d,contentTitle:()=>s,default:()=>l,frontMatter:()=>o,metadata:()=>a,toc:()=>c});const a=JSON.parse('{"id":"guides/programs/reporting/add-adaptive-time","title":"Add Adaptive Time Zone Parameters","description":"Set a specific time zone for your Reddit Ads API data. Use the time_zone_id parameter with date breakdowns or set a manual offset to localize reporting.","source":"@site/docs/guides/programs/reporting/add-adaptive-time.md","sourceDirName":"guides/programs/reporting","slug":"/guides/programs/reporting/add-adaptive-time","permalink":"/docs/v3/guides/programs/reporting/add-adaptive-time","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"title":"Add Adaptive Time Zone Parameters","description":"Set a specific time zone for your Reddit Ads API data. Use the time_zone_id parameter with date breakdowns or set a manual offset to localize reporting.","sidebar_position":1},"sidebar":"tutorialSidebar","previous":{"title":"Reporting","permalink":"/docs/v3/guides/programs/reporting"},"next":{"title":"Filter Metrics","permalink":"/docs/v3/guides/programs/reporting/filter-metrics"}}');var n=i(74848),r=i(28453);const o={title:"Add Adaptive Time Zone Parameters",description:"Set a specific time zone for your Reddit Ads API data. Use the time_zone_id parameter with date breakdowns or set a manual offset to localize reporting.",sidebar_position:1},s=void 0,d={},c=[];function m(e){const t={admonition:"admonition",code:"code",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["The API defaults to returning data in Coordinated Universal Time (UTC). If you need data in a certain time zone, the ",(0,n.jsx)(t.code,{children:"time_zone_id"})," parameter is effective only when the breakdowns include date details. If not, you can set the time offset with ",(0,n.jsx)(t.code,{children:"start_at"})," and ",(0,n.jsx)(t.code,{children:"end_at"})," to match your desired time zone."]}),"\n",(0,n.jsxs)(t.p,{children:["To return details about the time zone used by our API, you can call ",(0,n.jsx)(t.code,{children:"List Time Zones"}),", which returns information like the time zone code, offset, and daylight saving time status:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-json",children:'{\n "data": [\n {\n "code": "PT",\n "dst_offset": 3600,\n "id": "America/Los_Angeles",\n "is_dst_active": false,\n "name": "Pacific Time",\n "offset": -28800\n }\n ],\n "pagination": {\n "next_url": "https://ads-api.reddit.com/api/v3?page.token=nextToken",\n "previous_url": "https://ads-api.reddit.com/api/v3?page.token=previousToken"\n }\n}\n'})}),"\n",(0,n.jsxs)(t.p,{children:["This call can be integrated into middleware to periodically retrieve the offset (",(0,n.jsx)(t.code,{children:"dst_offset"}),") and accommodate daylight savings time (",(0,n.jsx)(t.code,{children:"is_dst_active"}),")."]}),"\n",(0,n.jsx)(t.admonition,{type:"note",children:(0,n.jsx)(t.p,{children:"Offset values are returned in seconds, so remember to adjust your timestamps accordingly."})}),"\n",(0,n.jsxs)(t.p,{children:["To make this easier, you can use third-party tools and libraries. For example, the ",(0,n.jsx)(t.code,{children:"moment.js"})," library lets you handle time zone conversions:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"var jun = moment(\"2014-06-01T12:00:00Z\");\n\nvar dec = moment(\"2014-12-01T12:00:00Z\");\n\njun.tz('America/New_York').format('ha z'); // 8am EDT\n\ndec.tz('America/New_York').format('ha z'); // 7am EST\n"})}),"\n",(0,n.jsx)(t.admonition,{type:"important",children:(0,n.jsx)(t.p,{children:"Keep in mind that third-party tools and libraries aren't officially endorsed or supported by Reddit."})})]})}function l(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(m,{...e})}):m(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.