»legacy_isotime Function

The legacy_isotime function returns the current date and time using the given format string. The format string follows golang's datetime formatting. See isotime-function-format-reference for more details.

This function has been provided to create backwards compatibility with Packer's legacy JSON templates. However, we recommend that you upgrade your HCL Packer template to use timestamp and formatdate together as soon as is convenient.

»Examples

> legacy_isotime("2006-01-02")
2021-04-19
> legacy_isotime("2006-01-02")2021-04-19

»Related Functions

  • format is a more general formatting function for arbitrary data.
  • timestamp returns the current date and time in a format suitable for input to formatdate.
  • formatdate can convert the resulting timestamp to other date and time formats.