Need the timepicker value from my dashboard and then display it in the stat widget

Hello,
I have a grafana dashboard, with the time picker in place. So i actually wanted to put whatever is selected in the timepicker into the stat widget.
Like for example if I selected last 1 year, I should be able to display in the stats widget as “1 year”.
I used $__from and $__to global variables, but that doesn’t show it as “last 6 months” or “last 1 year”

image

image