influxdata / influxdata/kapacitor

Feature Request: Timezone function in tick scripts

Open
#1,709 2 comments 6 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

**I would LOVE a TZ function that allows me to shift the timestamp** by timezone
maybe `timeZone({{.Time}}, "+5")` or `timeZone({{.Time}}, "AMERICA_NY")`

In my tick script, I currently set the message to this:
`var message = 'Alert fired @ {{.Time}}'`
which yields this alert in slack:
`Alert fired @ 2017-12-05 07:19:00 +0000 UTC` which would be more helpful if I can set the TZ.

Bonus: A function that formats the timestamp, but that's less important.

Possibly related:
https://github.com/influxdata/kapacitor/issues/1014

If you can give me some pointers, and this feature is desired, I'll happily work on a PR for this.

Contributor guide

Open the contributing guide

Research direction

No file or test is named; begin by tracing where tick scripts render {{.Time}} and review related issue #1014. Confirm the requested timezone input and output behavior, then add coverage showing the Slack timestamp is shifted; the formatting bonus is optional.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.