1

I am trying to get the current day and put in a local

locals {
  current_day = formatdate("DD/MM/YYYY", timestamp())
}

but a I get this error Call to unknown function; There is no function named "timestamp". Is timestamp function not supported in HCL2 anymore? Is there any other way to get the current day?

Kais
  • 99
  • 12

1 Answers1

0

It is working for me in the current version of HCL as of May 2022.

It appears that was not possible/was a bug in the version of HCL you were using. Here is a GitHub issue that few mentions functions not working in variables at the time:

MikeSchinkel
  • 4,947
  • 4
  • 38
  • 46