github.com/iaas-resource-provision/iaas-rpc@v1.0.7-0.20211021023331-ed21f798c408/website/docs/language/functions/timeadd.html.md (about)

     1  ---
     2  layout: "language"
     3  page_title: "timeadd - Functions - Configuration Language"
     4  sidebar_current: "docs-funcs-datetime-timeadd"
     5  description: |-
     6    The timeadd function adds a duration to a timestamp, returning a new
     7    timestamp.
     8  ---
     9  
    10  # `timeadd` Function
    11  
    12  `timeadd` adds a duration to a timestamp, returning a new timestamp.
    13  
    14  ```hcl
    15  timeadd(timestamp, duration)
    16  ```
    17  
    18  In the Terraform language, timestamps are conventionally represented as
    19  strings using [RFC 3339](https://tools.ietf.org/html/rfc3339)
    20  "Date and Time format" syntax. `timeadd` requires the `timestamp` argument
    21  to be a string conforming to this syntax.
    22  
    23  `duration` is a string representation of a time difference, consisting of
    24  sequences of number and unit pairs, like `"1.5h"` or `"1h30m"`. The accepted
    25  units are `"ns"`, `"us"` (or `"µs"`), `"ms"`, `"s"`, `"m"`, and `"h"`. The first
    26  number may be negative to indicate a negative duration, like `"-2h5m"`.
    27  
    28  The result is a string, also in RFC 3339 format, representing the result
    29  of adding the given direction to the given timestamp.
    30  
    31  ## Examples
    32  
    33  ```
    34  > timeadd("2017-11-22T00:00:00Z", "10m")
    35  2017-11-22T00:10:00Z
    36  ```