Convert time to epoch in alert notification

I am setting up some alerts on logs that come from Loki. I can get a timestamp from the log entry. I would like to take that timestamp and use it to create a link to a dashboard with a pre-set time range. This would allow my users who get a logging alert notification to then click the link and see some context around the log entry, instead of just the log entry itself (which by itself is often not very helpful).

The notification template reference talks briefly about time formatting.

The Go time package constants do not have a format for epoch time.

Is there any mechanism in Grafana that can help me convert a timestamp into an epoch time so that I can use the from and to URL parameters?

I am a newbie and have just started using Grafana Alert notifications. I was also looking for an answer about it, but there was no luck. Anyway, I happened to Google the time package and found a function to convert a date to Unix.

Although my response here is a bit late, I hope someone finds it useful. Please try the ‘Unix’ function from the time package. For example, usage will be like this:

Print in second
{{ .StartsAt.Unix }}

Print in millisecond
{{ .StartsAt.UnixMilli }}

Print in microsecond
{{ .StartsAt.UnixMicro }}

Reference: time package - time - Go Packages

@nyinyitun83, yes, I think I can make that work. Good idea. I was hoping to take the timestamp from a log entry, but those are strings (not time.Time types). Using .StartsAt might just be good enough. Thanks!