summaryrefslogtreecommitdiff
path: root/docs-src
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2022-02-10 08:46:42 -0500
committerGitHub <noreply@github.com>2022-02-10 08:46:42 -0500
commit9e1116b00e5657a032c491dce123d54dabbadfb4 (patch)
tree2ef31a47e45e8f5ec64eab77e983ae11342ec7ba /docs-src
parent0ca223237a0714eebe4e8f3da10e09031999537f (diff)
parent2c894b433f8ab17933acb8f97ecd41f118f67876 (diff)
Merge pull request #1300 from hairyhenderson/time-isdst-doc
Add example of how to use Time.IsDST
Diffstat (limited to 'docs-src')
-rw-r--r--docs-src/content/functions/time.yml10
1 files changed, 10 insertions, 0 deletions
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).