From 2c894b433f8ab17933acb8f97ecd41f118f67876 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Thu, 10 Feb 2022 08:37:38 -0500 Subject: Add example of how to use Time.IsDST Signed-off-by: Dave Henderson --- docs-src/content/functions/time.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs-src') diff --git a/docs-src/content/functions/time.yml b/docs-src/content/functions/time.yml index b208f432..92ecd675 100644 --- a/docs-src/content/functions/time.yml +++ b/docs-src/content/functions/time.yml @@ -92,6 +92,16 @@ funcs: ``` _(notice how the TZ adjusted for daylight savings!)_ + - | + Usage with [`IsDST`](https://golang.org/pkg/time/#Time.IsDST): + ```console + $ gomplate -i '{{ $t := time.Now }}At the tone, the time will be {{ ($t.Round (time.Minute 1)).Add (time.Minute 1) }}. + It is{{ if not $t.IsDST }} not{{ end }} daylight savings time. + ... ... BEEP' + At the tone, the time will be 2022-02-10 09:01:00 -0500 EST. + It is not daylight savings time. + ... ... BEEP + ``` - name: time.Parse description: | Parses a timestamp defined by the given layout. This wraps [`time.Parse`](https://golang.org/pkg/time/#Parse). -- cgit v1.2.3