是否可以获取当前时间 #154
Answered
by
liuyanmei069
liuyanmei069
asked this question in
Q&A
是否可以获取当前时间
#154
-
希望能实现显示持续时间,从告警触发到现在这个告警持续了多久时间。怎么在模板获取当前时间,用当前时间减去触发时间得到持续时间,这个可以怎么实现呢? |
Beta Was this translation helpful? Give feedback.
Answered by
liuyanmei069
Apr 2, 2021
Replies: 2 comments
-
已经找到解决方式,模板里填写{{ now }}可以获取当前时间,{{ ago .StartsAt }}获取触发时间到现在过去了多久时间,2h34m7s |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
timonwong
-
@liuyanmei069 老哥能告知具体写在那个文件里吗 我编辑了issue43/template.tmpl 这个文件 我看没生效 是我写的位置不对吗 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
已经找到解决方式,模板里填写{{ now }}可以获取当前时间,{{ ago .StartsAt }}获取触发时间到现在过去了多久时间,2h34m7s