{
  "slug": "packer-hcl2-rfc-3339-and-unix-timestamp-parsing-functions-2f987f4e3f5d",
  "title": "Packer HCL2 RFC 3339 and Unix timestamp parsing functions",
  "tools": [
    "packer"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-07-24T09:26:22.000Z",
  "announced_at": "2026-07-24T09:26:22.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a Packer HCL2 template needs to parse a timestamp, choose the function for the input format. Use `rfc3339_parse(<RFC3339 timestamp>)` for RFC 3339 input; use `unix_timestamp_parse(<RFC3339 timestamp or Unix epoch integer>)` for either format.",
    "examples": [
      "locals {\n  parsed = rfc3339_parse(\"<RFC3339 timestamp>\")\n}",
      "locals {\n  parsed = unix_timestamp_parse(<RFC3339 timestamp or Unix epoch integer>)\n}"
    ],
    "gotchas": [
      "Version: v1.16.0",
      "rfc3339_parse(timestamp) (required): Takes an RFC 3339 timestamp string; returns date fields and a `unix` attribute.",
      "unix_timestamp_parse(timestamp) (required): The v1.16.0 release note says it accepts an RFC 3339 timestamp or Unix epoch integer. Returns date fields and an RFC 3339 representation, per the implementation PR.",
      "Both functions accept RFC 3339 timestamps; `unix_timestamp_parse` additionally accepts Unix epoch integers.",
      "Docs conflict: The implementation PR describes `unix_timestamp_parse(unix_timestamp number)` as taking an epoch integer; the v1.16.0 release note says it also accepts RFC 3339 timestamps. Follow the release note's broader input support."
    ]
  },
  "why_it_matters": "When a Packer template needs to parse a timestamp, use the HCL2 timestamp parsing function that matches the input format.",
  "sources": [
    "https://github.com/hashicorp/packer/releases/tag/v1.16.0",
    "https://github.com/hashicorp/packer/pull/13669"
  ],
  "rank": 0.96021,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1-20261014",
    "verdict_id": "wave1-20261014:wave1-20261014-9c51c9cc7a7f1cd2-1:gate",
    "evidence_hash": "72ab0ab6b1a0f442592bc7154d62d6e5c5a1ebe208574ec7804eb9c8e288feeb"
  },
  "review": {
    "draft_hash": "456f6cf4d0d5bd1ca2d5ef532404735810afc65bdab8b17257893b614212fd06",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1-20261014:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.96 >= 0.9; 2 needed) and Jev gave 0.68 (>= 0.6 needed)."
  }
}
