github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/hcl2/functions/datetime/timeadd.mdx (about) 1 --- 2 layout: docs 3 page_title: timeadd - Functions - Configuration Language 4 sidebar_title: 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 Nomad 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 ```shell-session 34 > timeadd("2017-11-22T00:00:00Z", "10m") 35 2017-11-22T00:10:00Z 36 ```