From 5a073e52328f845115e51086d7efba7904c7126f Mon Sep 17 00:00:00 2001 From: idanoo Date: Mon, 13 Feb 2023 08:09:54 +1300 Subject: [PATCH] Check day --- internal/gomastodonstats/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/gomastodonstats/main.go b/internal/gomastodonstats/main.go index 214c3ac..515ec82 100644 --- a/internal/gomastodonstats/main.go +++ b/internal/gomastodonstats/main.go @@ -26,7 +26,11 @@ func Run() { sendToMatrix(updatedMetrics) // Only post weekly here - weekday := time.Now().Weekday() + localTime, err := time.LoadLocation(TIMEZONE) + if err != nil { + log.Fatal(err) + } + weekday := time.Now().Local().In(localTime).Weekday() if weekday == time.Monday { postToMastodon(updatedMetrics) }