From d2a96dcd69ef126821bbc92899700e044bdec63d Mon Sep 17 00:00:00 2001 From: Aaron Raddon Date: Mon, 17 Jul 2017 21:11:16 -0700 Subject: [PATCH] Doc cleanup --- README.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e6169b0..8945a07 100644 --- a/README.md +++ b/README.md @@ -86,13 +86,6 @@ var examples = []string{ func main() { - // NOTE: This is very, very important to understand timezone parsing - // The time.Local global tells the parse function to use given - // location/zone for use in the time.Parse() function - // used by this library. - loc, _ := time.LoadLocation("America/Denver") - time.Local = loc - table := termtables.CreateTable() table.AddHeaders("Input", "Parsed, and Output as %v") @@ -105,6 +98,21 @@ func main() { } fmt.Println(table.Render()) } + +func init() { + // NOTE: This is very, very important to understand timezone parsing + // The time.Local global tells the parse function to use given + // location/zone for use in the time.Parse() function + // used by this library. It uses UTC by default. + if uzeTimeZone { + loc, _ := time.LoadLocation("America/Denver") + time.Local = loc + } else { + // This is the default behavior + //loc, _ := time.LoadLocation("UTC") + //time.Local = loc + } +} ``` **outputs**