# Use code to get timeframe selector values in dashboard

**URL:** <https://community.dynatrace.com/t/use-code-to-get-timeframe-selector-values-in-dashboard/53024>\
**Category:** Dashboarding\
**Tags:** timeframe, dynatrace-sdk, dashboards\
**Created:** [August 19, 2025, 2:18pm UTC](https://community.dynatrace.com/t/use-code-to-get-timeframe-selector-values-in-dashboard/53024 "2025-08-19T14:18:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZackE](https://avatars.discourse-cdn.com/v4/letter/z/9fc29f/32.png) [@ZackE](https://community.dynatrace.com/u/ZackE)\
**Post date:** [August 19, 2025, 2:18pm UTC](https://community.dynatrace.com/t/use-code-to-get-timeframe-selector-values-in-dashboard/53024/1 "2025-08-19T14:18:13Z")

</div>

Is there a way to get the timeframe selected for a dashboard using the SDK? I want to use the values in code variables/tiles.

---

<div class="post-metadata">

**Author:** ![ZackE](https://avatars.discourse-cdn.com/v4/letter/z/9fc29f/32.png) [@ZackE](https://community.dynatrace.com/u/ZackE)\
**Post date:** [September 25, 2025, 5:35pm UTC](https://community.dynatrace.com/t/use-code-to-get-timeframe-selector-values-in-dashboard/53024/2 "2025-09-25T17:35:50Z")

</div>

I found the answer to this. Use the “$dt\_timeframe\_from” and “$dt\_timeframe\_to” dashboard variables in any tile (including code tiles) to input the string date of the beginning and end of the timeframe selected in the dashboard.
