From a3daf4c68637f0dc44e30f909c1a0890870baf1b Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Tue, 18 May 2021 09:18:40 -0700 Subject: [PATCH] escape backticks --- .../legacy_json_templates/engine.mdx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/website/content/docs/templates/legacy_json_templates/engine.mdx b/website/content/docs/templates/legacy_json_templates/engine.mdx index 51a2977cd..cec75af01 100644 --- a/website/content/docs/templates/legacy_json_templates/engine.mdx +++ b/website/content/docs/templates/legacy_json_templates/engine.mdx @@ -235,8 +235,10 @@ documentation for more information on user variables. # isotime Function Format Reference -The way you format isotime in golang is a bit nontraditional compared to how -you may be used to formatting datetime strings. +The isotime template engine uses golang to generate timestamps. If you're +unfamiliar with golang, then the way you format the timestamp is going to +feel a bit unusual compared to how you may be used to formatting +datetime strings. Full docs and examples for the golang time formatting function can be found [here](https://golang.org/pkg/time/#example_Time_Format) @@ -273,14 +275,14 @@ You can try and modify the following examples in a packer template or in | Input | Output | | ------------------------------------------ | ----------- | -| "packer-{{isotime `2006-01-02`}}" | "packer-2021-05-17 11:40:16" | -| "packer-{{isotime `Jan-_2-15:04:05.000`}}" | "packer-May-17-23:40:16.786" | -| "packer-{{isotime `3:04PM`}}" | "packer-11:40PM" | -| "{{ isotime }} | "June 7, 7:22:43pm 2014" | -| "{{isotime `2006-01-02`}}" | "2014-06-07" | -| "{{isotime `Mon 1504`}}" | "Sat 1922" | -| "{{isotime `02-Jan-06 03\_04\_05`}}" | "07-Jun-2014 07\_22\_43" | -| "{{isotime `Hour15Year200603`}}" | "Hour19Year201407" | +| ``"packer-{{isotime `2006-01-02`}}"`` | "packer-2021-05-17 11:40:16" | +| ``"packer-{{isotime `Jan-_2-15:04:05.000`}}"`` | "packer-May-17-23:40:16.786" | +| ``"packer-{{isotime `3:04PM`}}"`` | "packer-11:40PM" | +| ``"{{ isotime }}"`` | "June 7, 7:22:43pm 2014" | +| ``"{{isotime `2006-01-02`}}"`` | "2014-06-07" | +| ``"{{isotime `Mon 1504`}}"`` | "Sat 1922" | +| ``"{{isotime `02-Jan-06 03\_04\_05`}}"`` | "07-Jun-2014 07\_22\_43" | +| ``"{{isotime `Hour15Year200603`}}"`` | "Hour19Year201407" | Formatting for the function `isotime` uses the magic reference date **Mon Jan 2