From f0360c1efea120fe3bfa58b65649869b1a125f22 Mon Sep 17 00:00:00 2001 From: Julio Monteiro Date: Wed, 27 Feb 2019 16:55:10 -0300 Subject: [PATCH] Added support for Brazillian time BRT --- holobot.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/holobot.go b/holobot.go index 1441d5b..d3446d8 100644 --- a/holobot.go +++ b/holobot.go @@ -192,6 +192,8 @@ func main() { loc = "Asia/Kolkata" case "ADT", "AEDT", "ASDT", "AUSTRALIA", "MELBOURNE": loc = "Australia/Melbourne" + case "BRT", "BRST", "BRASIL", "BRAZILLIAN": + loc = "America/Sao_Paulo" default: loc = m[4] //default } @@ -250,12 +252,14 @@ func main() { ist := t.In(istl).Format("3:04 PM") adtl, _ := time.LoadLocation("Australia/Melbourne") adt := t.In(adtl).Format("3:04 PM") + brtl, _ := time.LoadLocation("America/Sao Paulo") + brt := t.In(brtl).Format("3:04 PM") // and prints them in a table timeZoneText = fmt.Sprintf(`"%s" is: -| PT | MT | CT | ET | GMT | CET | IST | ADT | +| PT | MT | CT | ET | GMT | CET | IST | ADT | BRT | |:--------:|:---------:|:--------:|:--------:|:-------:|:------:|:--------:|:--------:| -| %s | %s | %s | %s | %s | %s | %s | %s |`, m[0], pt, mt, ct, et, gmt, cet, ist, adt) +| %s | %s | %s | %s | %s | %s | %s | %s |`, m[0], pt, mt, ct, et, gmt, cet, ist, adt, brt) // make a debugging message with extra info about the above processes debuggingTimeZoneText = fmt.Sprintf("➚ **Debugging Info:**\n(%v)\nTime zone I heard (m[4]) was: %v\nLocation (l): %v\nPost.Id: %v\npost.RootId: %v", t, m[4], l, post.Id, post.RootId)