---
title: "Examples of use - Date and Time steps"
url: "https://docs.robotiq.ai/en/article/examples-of-use-date-and-time-steps"
language: "en"
last_updated: "2024-10-17T07:21:31.831Z"
---

# Examples of use - Date and Time steps

This is an example that shows how to use the following steps:

-   [**Get Current Date Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/get-current-date-step)
-   [**Add To Date Time Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/add-to-date-time-step)
-   [**Subtract Date Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/subtract-date-step)
-   [**Convert Date Time To Text Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/convert-date-time-to-text-step)
-   [**Convert Text To Date Time Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/convert-text-to-date-time-step)

### Get Current Date Step

First, we will use step "Get Current Date Step" and store date and time value to new variable DateTimeVariable.

![](https://cdn-assets.productfruits.com/1904bc0d-ac6d-433c-9197-0cb5a447b173)

**Input and Output variables:**

![](https://cdn-assets.productfruits.com/2d6aa0d7-2253-4773-ae21-8b7ea13f99b8)

### **Add To Date Time Step**

After creating a DateTime variable, we will add 3 days to it using the "**Add To DateTime**" step and save the result to a new variable called NewDateTime.

![](https://cdn-assets.productfruits.com/2dc9643f-2c18-4025-bb61-8efaf444207f)

**Input and Output variables:**

![](https://cdn-assets.productfruits.com/d9101c21-2c9a-4714-a5c2-4676ac99fc87)

### **Subtract Date Step**

For the "Subtract Date Step", we will select 01.01.2024 at 09:00 from the date picker and use the existing variable NewDateTime. 

![](https://cdn-assets.productfruits.com/11bcf144-0ad1-4f45-9615-2af8bbea3581)

![](https://cdn-assets.productfruits.com/e831b4e4-49a8-49b0-9286-738d3ff07403)![](https://cdn-assets.productfruits.com/07e77f56-6502-47e4-893a-db59eade3fd6)

**Input and Output variables:**

![](https://cdn-assets.productfruits.com/163aab4b-601b-4fd0-a8e0-bbb160af63e0)

### Convert Date Time To Text Step

To convert a DateTime variable to a string, use the "**Convert Date Time To Text Step**". 

![](https://cdn-assets.productfruits.com/c0350941-9a54-457b-b77d-e9450742212f)

**Input and Output variables:**

![](https://cdn-assets.productfruits.com/0d60afbe-3788-4cf4-a875-f45221c7a646)

### **Convert Text To Date Time Step**

Now, we can convert the created string variable to a new DateTime variable using the "**Convert Text To Date Time Step**". Since we did not specify a time in the string variable, our new DateTime variable will only contain the date (and time 12:00 as default).

![](https://cdn-assets.productfruits.com/bad5a122-4115-49da-8135-8adaa77bb4b2)

**Input and Output variables:**

![](https://cdn-assets.productfruits.com/1c74f1a4-c5ca-4e7b-8ec4-da8380e6af1f)
