> 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.

# extractField

> Use the extractField task to extract a specific time field such as day, month, or year from a timestamp.

The `extractField` task extracts a specific time field — such as day, month, year, or any other supported unit — from a given timestamp.

## Potential use case

Use `extractField` when you need to pull a specific time component from a dataset, such as extracting just the year from a timestamp for sorting or reporting purposes.

## Properties

| Incoming       | Type   | Description                                                                                                                                               |
| :------------- | :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `inputTime`    | Object | Required. The time representation to extract a field from.                                                                                                |
| `field`        | Enum   | Required. The field to extract. Allowed values are: Millisecond, Second, Minute, Hour, Day of Week, Day of Month, Day of Year, Week of Year, Month, Year. |
| `outputFormat` | Enum   | The format of the extracted value. Allowed values are: `String`, `Number`.                                                                                |

| Outgoing         | Type   | Description                |
| :--------------- | :----- | :------------------------- |
| `timeFieldValue` | String | The extracted field value. |

## Example

In this example, the `inputTime` object pulls time fields from `{"$ref": "timeProperties#/definitions/timeObject"}`. The `field` selected is **Year** and `outputFormat` is **String**. Setting `outputFormat` to **Number** produces an identical result.

![](/_fern-img/7ff1e50582e1540e3d46ef8fda45d6d18d93f44c768bd66b09e9d2c704d65872.webp)

The outgoing `timeFieldValue` returns the year `"2020"`.

![](/_fern-img/2378e0de3f90133a74c71b3a66ef5bfbb4de8a825537ba1b96a2a73951142f4e.webp)