Use code to get timeframe selector values in dashboard

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.