# How to create a link to grafana dashboard from alert to calculated time range?

**URL:** <https://community.grafana.com/t/how-to-create-a-link-to-grafana-dashboard-from-alert-to-calculated-time-range/131937>\
**Category:** Alerting\
**Tags:** templating, alerting\
**Created:** [September 12, 2024, 2:20pm UTC](https://community.grafana.com/t/how-to-create-a-link-to-grafana-dashboard-from-alert-to-calculated-time-range/131937 "2024-09-12T14:20:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kamilcuk](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/kamilcuk/32/37095_2.png) [@kamilcuk](https://community.grafana.com/u/kamilcuk)\
**Post date:** [September 12, 2024, 2:58pm UTC](https://community.grafana.com/t/how-to-create-a-link-to-grafana-dashboard-from-alert-to-calculated-time-range/131937/2 "2024-09-12T14:58:35Z")

</div>

Actually I DID IT! YAY!

So StartsAt is an object, and you can actually call an arbitrary object methos in go template. And it happens Time object has Add and Sub methods, and duration is in milliseconds.

```auto
{{- .Annotations.URL -}}&from={{- (.StartsAt.Sub -3600000000000).UnixMilli -}}&to={{{- (.StartsAt.Add 300000000000).UnixMilli -}}

```

---

_[View the full topic](https://community.grafana.com/t/how-to-create-a-link-to-grafana-dashboard-from-alert-to-calculated-time-range/131937)._
