From: Dan Fuhry Date: Wed, 3 Jun 2026 04:52:53 +0000 (-0400) Subject: [constants] add BuildTimestampTime X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=refs%2Fheads%2Fmain;p=runtime.git [constants] add BuildTimestampTime --- diff --git a/constants/BUILD.bazel b/constants/BUILD.bazel index b9a36a7..e61ae48 100644 --- a/constants/BUILD.bazel +++ b/constants/BUILD.bazel @@ -15,7 +15,10 @@ genrule( go_multi_library( name = "constants", - srcs = ["constants.go"], + srcs = [ + "constants.go", + "helpers.go", + ], importpath = "go.fuhry.dev/runtime/constants", visibility = ["//visibility:public"], ) diff --git a/constants/helpers.go b/constants/helpers.go new file mode 100644 index 0000000..0ecb003 --- /dev/null +++ b/constants/helpers.go @@ -0,0 +1,14 @@ +package constants + +import ( + "strconv" + "time" +) + +func BuildTimestampTime() time.Time { + ts, err := strconv.ParseInt(BuildTimestamp, 10, 64) + if err != nil { + panic(err) + } + return time.Unix(ts, 0) +}