> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# getTime

> Use the getTime task to obtain a current timestamp for use in a workflow, with an optional offset.

The `getTime` task obtains a current timestamp for use in other tasks in a workflow. An offset may be applied to the current timestamp if needed. The `getTime` task uses UTC for time representation.

## Potential use case

Use this task to post the current time in a logfile or external database when an automation starts or completes. Using an `offsetDuration`, you can also use this task to provide a future timestamp calculated from the current time.

## Properties

### Input variables

| Incoming         | Type   | Description                                                                                                                                                                                                                                                                 | Example                                                     |
| :--------------- | :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------- |
| `Timezone`       | Enum   | Required. The timezone to use for getting the current time.                                                                                                                                                                                                                 | EST UTC: `−05:00` / EDT UTC: `−04:00`                       |
| `offsetDuration` | Object | Optional. A duration to offset the current time, expressed as object literal notation. For example, `{"days": 7, "months": 1}` adds seven days and one month to the current timestamp. Numeric values without designators are treated as milliseconds.                      | `{"days": 7, "months": 1}` / `{"hours": 4}` / `31556926000` |
| `format`         | String | Optional. The format in which the converted timestamp should be displayed. Accepts formats from the [moment.js documentation](https://momentjs.com/docs/#/displaying/format/). Leaving this blank defaults the outgoing `time` parameter to `YYYY-MM-DDTHH:mm:ss.SSSSSSZZ`. | `LLLL` / `MMM-DD-YYYY` / `hh:mm:ss`                         |

When using object literal notation in `offsetDuration`, you must include the curly braces. See the [moment.js documentation](https://momentjs.com/docs/#/displaying/format/) for more information.

### Output variables

| Outgoing | Type   | Description                                                                                               |
| :------- | :----- | :-------------------------------------------------------------------------------------------------------- |
| `time`   | Object | The timestamp returned by the task, presented in the format specified by the incoming `format` parameter. |

## Example 1

In this example:

* `Timezone` is UTC `−04:00` (North American Eastern Time).
* `offsetDuration` adds seven days and one month.
* `format` is `LLLL` (month name, day of month, day of week, year, time).
* The outgoing `time` value is presented in `LLLL` format.

![](/_fern-img/bb81f8dfa4c29e5ebdb3228f66b6b6ff4d20aff7f6bb7786acbe4c8b34d807fb.webp)

## Example 2

In this example:

* `Timezone` is UTC `−04:00` (North American Eastern Time).
* `offsetDuration` is `86400000` milliseconds (one day).
* `format` is `MMM-DD-YYYY` (month-day-full year).
* The outgoing `time` value is presented in `MMM-DD-YYYY` format.

![](/_fern-img/23821b8dcd9b0e456605a30978a87079b6fa3389680c65253404c92ffd87c0e1.webp)

## Example 3

In this example:

* `Timezone` is UTC `−04:00` (North American Eastern Time).
* `offsetDuration` adds four hours.
* `format` is `hh:mm:ss` (hours:minutes:seconds).
* The outgoing `time` value is presented in `hh:mm:ss` format.

![](/_fern-img/0243ab4b35c451537c50c9028e389db86ba847238454f77fedb7f4b6515765e6.webp)