# Extract part of a date transform action

## Use Case

You have received a date in a response from an API, you are going to use this to dynamically specify the year in another request based on what was received in the response.

## Overview

Given a date or date time string, extract a part of the date.

<figure><img src="https://1835401289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQQ1EHVcEsGKBPVHmiav%2Fuploads%2FQNDRK9vYSfAkknz0fH7U%2FScreenshot%202025-09-09%20at%209.39.20%E2%80%AFAM.png?alt=media&#x26;token=b5c745b1-d412-4685-81fb-c2edb53573ff" alt=""><figcaption></figcaption></figure>

## Parameters

<table><thead><tr><th width="217">Parameter</th><th width="417.3333333333333">Description</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>Date Time String</td><td>The original date time string to extract a part from.</td><td>true</td></tr><tr><td>Part to Extract</td><td>The part of the date to extract. Defaults to year.</td><td>true</td></tr></tbody></table>

## Usage

<details>

<summary>Example 1: Extract the year from a date</summary>

Inputs: **Date Time String**: 2025-06-27T00:05:24.000 **Part**: Year (4 digits)

</details>

<details>

<summary>Example 2: Extract the day from a date</summary>

Inputs: **Date Time String**: 2025-06-27T00:05:24.000 **Part**: Day

</details>

## Results output

Result from Example 1:

```
2025
```

Result from Example 2:

```
27
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rewst.help/documentation/automations/actions-in-rewst/transform-actions/extract-part-of-a-date-transform-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
