# Date

## Introduction

The Date library in Automate provides actions for handling operations related to historical dates. These actions empower users to convert date values to strings and make time-dependent adjustments on date values within their workflows.

The purpose of the Date library is to streamline the manipulation and conversion of date values, enabling users to perform various operations to meet their workflow needs.

## What is Date?

The Date library consists of two main actions: **Convert Date to String** and **Modify Date**. These actions allow users to convert date values to strings and adjust historical dates based on specific criteria.

#### Key Features

* <mark style="color:orange;">**Convert Date to String:**</mark>
  * <mark style="color:orange;">Convert date values to string format.</mark>
* <mark style="color:orange;">**Modify Date:**</mark>
  * <mark style="color:orange;">Make time-dependent adjustments on date values.</mark>

## Usage of the Action

### Convert Date to String

<figure><img src="/files/CZTJ5gw8y3IkKJiYg4Js" alt=""><figcaption></figcaption></figure>

**Description:** The **Convert Date to String** action converts date values into string format using specified formats.

**Usage:**

1. <mark style="color:green;">**Source Date:**</mark>
   * <mark style="color:green;">Enter the date value to convert to a string.</mark>
   * <mark style="color:green;">This field accepts keyboard input or variable selection.</mark>
2. <mark style="color:green;">**New Date Format:**</mark>
   * <mark style="color:green;">Specify the format of the date.</mark>
   * <mark style="color:green;">Enter the desired format or choose a variable.</mark>
3. <mark style="color:green;">**Assign the Output to Variable:**</mark>
   * <mark style="color:green;">Select the string variable to assign the converted date value.</mark>

### Modify Date

<figure><img src="/files/zYznPFVSv8WSQFcAAKUf" alt=""><figcaption></figcaption></figure>

**Description:** The **Modify Date** action allows users to adjust historical date values based on specific criteria.

**Usage:**

1. **Date:**
   * Select the date value to be modified.
   * This field contains only date-type variables.
2. **Add Modification:**
   * Choose from three different modification rules:
     * **Custom:**
       * <mark style="color:orange;">Adjust the date using an adjustment bar.</mark>
       * <mark style="color:orange;">Select the time unit and adjust the bar accordingly.</mark>
       * <mark style="color:orange;">Rules:</mark>
         * <mark style="color:orange;">Maximum adjustment for "month" is "+- 12".</mark>
         * <mark style="color:orange;">Maximum adjustment for "week" is "+-52".</mark>
         * <mark style="color:orange;">Enter values on the right for addition and on the left for subtraction.</mark>
     * **Find Next/Previous day of Week:**
       * <mark style="color:blue;">Return the date to the next or previous weekdays.</mark>
       * <mark style="color:blue;">Select the option for next or previous.</mark>
       * <mark style="color:blue;">Choose the day of the week.</mark>
       * <mark style="color:blue;">Example:</mark>
         * <mark style="color:blue;">Input: Wednesday 05.05.2021</mark>
         * <mark style="color:blue;">Selected: Next Friday</mark>
         * <mark style="color:blue;">Output: Friday 07.05.2021</mark>
     * **Find Start/End day of Week/Month/Year:**
       * <mark style="color:purple;">Return the date to the first or last days of specified units.</mark>
       * <mark style="color:purple;">Select the option for first or end day.</mark>
       * <mark style="color:purple;">Choose the time unit (month, year, week, day).</mark>
       * <mark style="color:purple;">Example:</mark>
         * <mark style="color:purple;">Input: Wednesday 05.05.2021</mark>
         * <mark style="color:purple;">Selected: First Day of the month</mark>
         * <mark style="color:purple;">Output: Monday 01.05.2021</mark>

### **Convert Date to Timestamp**

**Description:** The Convert Date to Timestamp action allows users to convert date values into timestamps, providing a way to represent dates as numeric values.

**Purpose:** Timestamps are widely used in computing to represent date and time information as a single numeric value, which is particularly useful for sorting, comparison, and calculations.

**Usage:**

**Inputs:**

* <mark style="color:green;">**Source Date (Required):**</mark> <mark style="color:green;"></mark><mark style="color:green;">Input the date value to be converted into a timestamp.</mark>
* <mark style="color:green;">**Source Date Format:**</mark> <mark style="color:green;"></mark><mark style="color:green;">Specify the format of the source date using one of the provided formats (e.g., DD-MM-YYYY, MM.DD.YYYY, YYYY/MM/DD).</mark>
* <mark style="color:green;">**Timestamp Format:**</mark> <mark style="color:green;"></mark><mark style="color:green;">Choose the desired timestamp format (e.g., Millisecond, Second).</mark>
* <mark style="color:green;">**Assign the output to variable (Required):**</mark> <mark style="color:green;"></mark><mark style="color:green;">Select a variable to store the generated timestamp.</mark>

**Outputs:**

* **Expected results:** The action will generate a timestamp based on the provided date value and format, assigning it to the specified variable.

***

## Additional Tips

### [**Use Cases**](/userguide/use-cases.md)

### [FAQ](/userguide/faq.md)


---

# 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.autommate.com/userguide/libraries/transform/date.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.
